Browse Source

syntax fixes

Avoid compile warnings about the use of undefined constants

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Peter S. Mazinger 13 years ago
parent
commit
de71e42c04
3 changed files with 8 additions and 8 deletions
  1. 2 2
      include/ftw.h
  2. 2 2
      libc/misc/ftw/ftw.c
  3. 4 4
      libpthread/nptl/allocatestack.c

+ 2 - 2
include/ftw.h

@@ -129,7 +129,7 @@ typedef int (*__nftw64_func_t) (__const char *__filename,
 # endif
 # endif
 #endif
 #endif
 
 
-#if __UCLIBC_HAS_FTW__
+#ifdef __UCLIBC_HAS_FTW__
 /* Call a function on every element in a directory tree.
 /* Call a function on every element in a directory tree.
 
 
    This function is a possible cancellation point and therefore not
    This function is a possible cancellation point and therefore not
@@ -151,7 +151,7 @@ extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
 # endif
 # endif
 #endif
 #endif
 
 
-#if __UCLIBC_HAS_NFTW__ && defined __USE_XOPEN_EXTENDED
+#if defined __UCLIBC_HAS_NFTW__ && defined __USE_XOPEN_EXTENDED
 /* Call a function on every element in a directory tree.  FLAG allows
 /* Call a function on every element in a directory tree.  FLAG allows
    to specify the behaviour more detailed.
    to specify the behaviour more detailed.
 
 

+ 2 - 2
libc/misc/ftw/ftw.c

@@ -752,7 +752,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
 
 
 
 
 /* Entry points.  */
 /* Entry points.  */
-#if __UCLIBC_HAS_FTW__
+#ifdef __UCLIBC_HAS_FTW__
 int
 int
 FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors)
 FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors)
 {
 {
@@ -760,7 +760,7 @@ FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors)
 }
 }
 #endif
 #endif
 
 
-#if __UCLIBC_HAS_NFTW__
+#ifdef __UCLIBC_HAS_NFTW__
 #ifndef _LIBC
 #ifndef _LIBC
 int
 int
 NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)
 NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags)

+ 4 - 4
libpthread/nptl/allocatestack.c

@@ -122,7 +122,7 @@ static uintptr_t in_flight_stack;
 list_t __stack_user __attribute__ ((nocommon));
 list_t __stack_user __attribute__ ((nocommon));
 hidden_data_def (__stack_user)
 hidden_data_def (__stack_user)
 
 
-#if COLORING_INCREMENT != 0
+#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0
 /* Number of threads created.  */
 /* Number of threads created.  */
 static unsigned int nptl_ncreated;
 static unsigned int nptl_ncreated;
 #endif
 #endif
@@ -443,7 +443,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       void *mem = 0;
       void *mem = 0;
       const int prot = (PROT_READ | PROT_WRITE);
       const int prot = (PROT_READ | PROT_WRITE);
 
 
-#if COLORING_INCREMENT != 0
+#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0
       /* Add one more page for stack coloring.  Don't do it for stacks
       /* Add one more page for stack coloring.  Don't do it for stacks
 	 with 16 times pagesize or larger.  This might just cause
 	 with 16 times pagesize or larger.  This might just cause
 	 unnecessary misalignment.  */
 	 unnecessary misalignment.  */
@@ -474,7 +474,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	     adjust the allocated stack size if necessary.  This way
 	     adjust the allocated stack size if necessary.  This way
 	     allocations directly following each other will not have
 	     allocations directly following each other will not have
 	     aliasing problems.  */
 	     aliasing problems.  */
-#if MULTI_PAGE_ALIASING != 0
+#if defined MULTI_PAGE_ALIASING && MULTI_PAGE_ALIASING != 0
 	  if ((size % MULTI_PAGE_ALIASING) == 0)
 	  if ((size % MULTI_PAGE_ALIASING) == 0)
 	    size += pagesize_m1 + 1;
 	    size += pagesize_m1 + 1;
 #endif
 #endif
@@ -494,7 +494,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	     So we can never get a null pointer back from mmap.  */
 	     So we can never get a null pointer back from mmap.  */
 	  assert (mem != NULL);
 	  assert (mem != NULL);
 
 
-#if COLORING_INCREMENT != 0
+#if defined COLORING_INCREMENT && COLORING_INCREMENT != 0
 	  /* Atomically increment NCREATED.  */
 	  /* Atomically increment NCREATED.  */
 	  unsigned int ncreated = atomic_increment_val (&nptl_ncreated);
 	  unsigned int ncreated = atomic_increment_val (&nptl_ncreated);