From 7f82ed2046cbc4bb594e7c2162d40c819daee111 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 23 Nov 2016 04:47:19 +0300 Subject: [PATCH] Fix Solaris/sparc detection in case of strict C compliance is enforced * include/gc_config_macros.h [__i386__ || __amd64__] (GC_SOLARIS_THREADS): Define also if __sun is defined (treat __sun as a synonym to sun). * include/private/gcconfig.h [__i386__ || __amd64] (SOLARIS): Likewise. * include/gc_config_macros.h [sun] (GC_SOLARIS_THREADS): Define also if __amd64 is defined (treat __amd64 as a synonym to __amd64__). * include/gc_config_macros.h [sparc && unix] (DRSNX): Do not define if SPARC and SOLARIS are already defined. --- include/gc_config_macros.h | 5 +++-- include/private/gcconfig.h | 17 ++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index 5234910..0e77ceb 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -88,8 +88,9 @@ # define GC_IRIX_THREADS # endif # if defined(__sparc) && !defined(__linux__) \ - || defined(sun) && (defined(i386) || defined(__i386__) \ - || defined(__amd64__)) + || ((defined(sun) || defined(__sun)) \ + && (defined(i386) || defined(__i386__) \ + || defined(__amd64) || defined(__amd64__))) # define GC_SOLARIS_THREADS # elif defined(__APPLE__) && defined(__MACH__) # define GC_DARWIN_THREADS diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index b1f370f..8b26ae2 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -208,12 +208,12 @@ # define SEQUENT # define mach_type_known # endif -# if defined(sun) && (defined(i386) || defined(__i386__)) +# if (defined(sun) || defined(__sun)) && (defined(i386) || defined(__i386__)) # define I386 # define SOLARIS # define mach_type_known # endif -# if defined(sun) && defined(__amd64) +# if (defined(sun) || defined(__sun)) && defined(__amd64) # define X86_64 # define SOLARIS # define mach_type_known @@ -226,16 +226,15 @@ # if defined(ibm032) && !defined(CPPCHECK) # error IBM PC/RT no longer supported. # endif -# if defined(sun) && (defined(sparc) || defined(__sparc)) +# if (defined(sun) || defined(__sun)) && (defined(sparc) || defined(__sparc)) # define SPARC /* Test for SunOS 5.x */ -# include -# define SOLARIS +# include +# define SOLARIS # define mach_type_known -# endif -# if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \ - && !defined(__OpenBSD__) && !defined(__NetBSD__) \ - && !defined(__FreeBSD__) && !defined(__DragonFly__) +# elif defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \ + && !defined(__OpenBSD__) && !defined(__NetBSD__) \ + && !defined(__FreeBSD__) && !defined(__DragonFly__) # define SPARC # define DRSNX # define mach_type_known -- 2.7.4