]> granicus.if.org Git - gc/commitdiff
Avoid potential 'macro redefinition' errors for config.h macros
authorIvan Maidanski <ivmai@mail.ru>
Fri, 16 Nov 2018 17:27:42 +0000 (20:27 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 26 Nov 2018 06:33:21 +0000 (09:33 +0300)
If a macro that could be defined in config.h could also be defined in
gc_config_macros.h or gcconfig.h then define it to the same value (1).

* include/gc_config_macros.h [!_REENTRANT && GC_PTHREADS
&& !GC_WIN32_THREADS] (_REENTRANT): Define to 1 instead of a blank.
* include/private/gcconfig.h [SPARC && SOLARIS && !USE_MMAP
&& REDIRECT_MALLOC] (USE_MMAP): Likewise.
* include/private/gcconfig.h [I386 && SOLARIS && !USE_MMAP
&& REDIRECT_MALLOC] (USE_MMAP): Likewise.
* include/private/gcconfig.h [I386 && DGUX && !USE_MMAP] (USE_MMAP):
Likewise.
* include/private/gcconfig.h [I386 && LINUX && __ELF__
&& !GC_NO_SIGSETJMP && (HOST_TIZEN || HOST_ANDROID)] (GC_NO_SIGSETJMP):
Likewise.
* include/private/gcconfig.h [I386 && DARWIN] (DARWIN_DONT_PARSE_STACK):
Likewise.
* include/private/gcconfig.h [AARCH64 && DARWIN]
(DARWIN_DONT_PARSE_STACK): Likewise.
* include/private/gcconfig.h [AARCH64 && NINTENDO_SWITCH]
(NO_HANDLE_FORK): Likewise.
* include/private/gcconfig.h [ARM32 && DARWIN]
(DARWIN_DONT_PARSE_STACK): Likewise.
* include/private/gcconfig.h [ARM32 && SN_TARGET_PSP2] (NO_HANDLE_FORK):
Likewise.
* include/private/gcconfig.h [X86_64 && DARWIN]
(DARWIN_DONT_PARSE_STACK): Likewise.
* include/private/gcconfig.h [X86_64 && SOLARIS && !USE_MMAP
&& REDIRECT_MALLOC] (USE_MMAP): Likewise.
* include/private/gcconfig.h [X86_64 && MSWIN_XBOX1 && !USE_MMAP]
(USE_MMAP): Likewise.
* include/private/gcconfig.h [(MSWIN32 || MSWINCE) && !USE_WINALLOC]
(USE_WINALLOC): Likewise.
* include/private/gcconfig.h [UNIX_LIKE && !NO_GETCONTEXT]
(NO_GETCONTEXT): Likewise.
* include/private/gcconfig.h [(FREEBSD || DARWIN && !_POSIX_C_SOURCE
|| SOLARIS && (!_XOPEN_SOURCE || __EXTENSIONS__) || LINUX)
&& !HAVE_DLADDR] (HAVE_DLADDR): Likewise.
* include/private/gcconfig.h [MAKE_BACK_GRAPH && !DBG_HDRS_ALL]
(DBG_HDRS_ALL): Likewise.

include/gc_config_macros.h
include/private/gcconfig.h

index d656e01ee10f2c1515855f41ae61202d17c9ce35..060090a734e751f0fc4f3100332704702db035d1 100644 (file)
 #if !defined(_REENTRANT) && defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS)
   /* Better late than never.  This fails if system headers that depend  */
   /* on this were previously included.                                  */
-# define _REENTRANT
+# define _REENTRANT 1
 #endif
 
 #define __GC
index d1ad8160e6eeccedc6f218c8b0a8e9b933620134..5caa29766619df5fd8848695942e0019f2a7e37f 100644 (file)
@@ -1228,7 +1228,7 @@ EXTERN_C_BEGIN
 #       define DATASTART_IS_FUNC
 #       define DATAEND ((ptr_t)(_end))
 #       if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
-#         define USE_MMAP
+#         define USE_MMAP 1
             /* Otherwise we now use calloc.  Mmap may result in the     */
             /* heap interleaved with thread stacks, which can result in */
             /* excessive blacklisting.  Sbrk is unusable since it       */
@@ -1405,7 +1405,7 @@ EXTERN_C_BEGIN
 #       endif
 #       define DYNAMIC_LOADING
 #       if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
-#         define USE_MMAP
+#         define USE_MMAP 1
             /* Otherwise we now use calloc.  Mmap may result in the     */
             /* heap interleaved with thread stacks, which can result in */
             /* excessive blacklisting.  Sbrk is unusable since it       */
@@ -1447,7 +1447,7 @@ EXTERN_C_BEGIN
 #       define GETPAGESIZE() (unsigned)sysconf(_SC_PAGESIZE)
 #       define DYNAMIC_LOADING
 #       ifndef USE_MMAP
-#         define USE_MMAP
+#         define USE_MMAP 1
 #       endif
 #       define MAP_FAILED (void *) ((word)-1)
 #       define HEAP_START (ptr_t)0x40000000
@@ -1495,7 +1495,7 @@ EXTERN_C_BEGIN
                /* (setjmp is used instead to find data_start).  The bug */
                /* is fixed in Android NDK r8e (so, ok to use sigsetjmp  */
                /* if gcc4.8+, clang3.2+ or Android API level 18+).      */
-#              define GC_NO_SIGSETJMP
+#              define GC_NO_SIGSETJMP 1
 #            endif
 #       else
              extern int etext[];
@@ -1696,7 +1696,7 @@ EXTERN_C_BEGIN
 #   endif
 #   ifdef DARWIN
 #     define OS_TYPE "DARWIN"
-#     define DARWIN_DONT_PARSE_STACK
+#     define DARWIN_DONT_PARSE_STACK 1
 #     define DYNAMIC_LOADING
       /* XXX: see get_end(3), get_etext() and get_end() should not be used. */
       /* These aren't used when dyld support is enabled (it is by default). */
@@ -2278,7 +2278,7 @@ EXTERN_C_BEGIN
 #   ifdef DARWIN
       /* iOS */
 #     define OS_TYPE "DARWIN"
-#     define DARWIN_DONT_PARSE_STACK
+#     define DARWIN_DONT_PARSE_STACK 1
 #     define DYNAMIC_LOADING
 #     define DATASTART ((ptr_t)get_etext())
 #     define DATAEND   ((ptr_t)get_end())
@@ -2319,7 +2319,7 @@ EXTERN_C_BEGIN
 #   endif
 #   ifdef NINTENDO_SWITCH
       extern int __bss_end[];
-#     define NO_HANDLE_FORK
+#     define NO_HANDLE_FORK 1
 #     define DATASTART (ptr_t)ALIGNMENT /* cannot be null */
 #     define DATAEND (ptr_t)(&__bss_end)
       void *switch_get_stack_bottom(void);
@@ -2409,7 +2409,7 @@ EXTERN_C_BEGIN
 #   ifdef DARWIN
       /* iOS */
 #     define OS_TYPE "DARWIN"
-#     define DARWIN_DONT_PARSE_STACK
+#     define DARWIN_DONT_PARSE_STACK 1
 #     define DYNAMIC_LOADING
 #     define DATASTART ((ptr_t)get_etext())
 #     define DATAEND   ((ptr_t)get_end())
@@ -2447,7 +2447,7 @@ EXTERN_C_BEGIN
 #     define DYNAMIC_LOADING
 #   endif
 #   ifdef SN_TARGET_PSP2
-#     define NO_HANDLE_FORK
+#     define NO_HANDLE_FORK 1
 #     define DATASTART (ptr_t)ALIGNMENT
 #     define DATAEND (ptr_t)ALIGNMENT
       void *psp2_get_stack_bottom(void);
@@ -2643,7 +2643,7 @@ EXTERN_C_BEGIN
 #   endif
 #   ifdef DARWIN
 #     define OS_TYPE "DARWIN"
-#     define DARWIN_DONT_PARSE_STACK
+#     define DARWIN_DONT_PARSE_STACK 1
 #     define DYNAMIC_LOADING
       /* XXX: see get_end(3), get_etext() and get_end() should not be used. */
       /* These aren't used when dyld support is enabled (it is by default)  */
@@ -2744,7 +2744,7 @@ EXTERN_C_BEGIN
 #       endif
 #       define DYNAMIC_LOADING
 #       if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
-#         define USE_MMAP
+#         define USE_MMAP 1
             /* Otherwise we now use calloc.  Mmap may result in the     */
             /* heap interleaved with thread stacks, which can result in */
             /* excessive blacklisting.  Sbrk is unusable since it       */
@@ -2764,7 +2764,7 @@ EXTERN_C_BEGIN
 #     define STACKBOTTOM ((ptr_t)durango_get_stack_bottom())
 #     define GETPAGESIZE() 4096
 #     ifndef USE_MMAP
-#       define USE_MMAP
+#       define USE_MMAP 1
 #     endif
       /* The following is from sys/mman.h:  */
 #     define PROT_NONE  0
@@ -2882,7 +2882,7 @@ EXTERN_C_BEGIN
 #endif
 
 #if defined(USE_MMAP_ANON) && !defined(USE_MMAP)
-#   define USE_MMAP
+#   define USE_MMAP 1
 #elif defined(LINUX) && defined(USE_MMAP)
     /* The kernel may do a somewhat better job merging mappings etc.    */
     /* with anonymous mappings.                                         */
@@ -3070,7 +3070,7 @@ EXTERN_C_BEGIN
 
 #if (defined(MSWIN32) || defined(MSWINCE)) && !defined(USE_WINALLOC)
   /* USE_WINALLOC is only an option for Cygwin. */
-# define USE_WINALLOC
+# define USE_WINALLOC 1
 #endif
 
 #ifdef USE_WINALLOC
@@ -3162,7 +3162,7 @@ EXTERN_C_BEGIN
      || (defined(LINUX) && !defined(__gnu_linux__)) \
      || (defined(RTEMS) && defined(I386)) || defined(HOST_ANDROID)) \
     && !defined(NO_GETCONTEXT)
-# define NO_GETCONTEXT
+# define NO_GETCONTEXT 1
 #endif
 
 #ifndef PREFETCH
@@ -3468,11 +3468,11 @@ EXTERN_C_BEGIN
         || (defined(SOLARIS) && (!defined(_XOPEN_SOURCE) \
                                  || defined(__EXTENSIONS__))) \
         || defined(LINUX)) && !defined(HAVE_DLADDR)
-# define HAVE_DLADDR
+# define HAVE_DLADDR 1
 #endif
 
 #if defined(MAKE_BACK_GRAPH) && !defined(DBG_HDRS_ALL)
-# define DBG_HDRS_ALL
+# define DBG_HDRS_ALL 1
 #endif
 
 #if defined(POINTER_MASK) && !defined(POINTER_SHIFT)