Fix Solaris/sparc detection in case of strict C compliance is enforced
authorIvan Maidanski <ivmai@mail.ru>
Wed, 23 Nov 2016 01:47:19 +0000 (04:47 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 23 Nov 2016 01:47:19 +0000 (04:47 +0300)
* 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
include/private/gcconfig.h

index 5234910..0e77ceb 100644 (file)
@@ -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
index b1f370f..8b26ae2 100644 (file)
 #    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
 # 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 <errno.h>
-#     define SOLARIS
+#   include <errno.h>
+#   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