265501: Merge 32 and 64 bit versions of prcpucfg.h on Solaris NSPR_4_5_BRANCH
authorchristophe.ravel.bugs%sun.com
Fri, 22 Oct 2004 16:45:03 +0000
branchNSPR_4_5_BRANCH
changeset 3201 ff21e178dcc972db35beeeb8e980a947105795f4
parent 3200 7d4997a62b3891b13de5ff2bbcfa571bb15170f2
child 3202 3edf91af4f7063938ad51830e279ad015dab8beb
push idunknown
push userunknown
push dateunknown
bugs265501
265501: Merge 32 and 64 bit versions of prcpucfg.h on Solaris Flag _LP64 is not defined by any compiler (gcc and Forte 9) on AMD64 machine. Using the following logic: if __sparc or sparc if __sparcv9 : 64 bit sparc else : 32 bit sparc else if __x86_64 : 64 bit AMD elseif i386 or __i386: 32 bit x86 else : unknown processor
pr/include/md/_solaris.cfg
--- a/pr/include/md/_solaris.cfg
+++ b/pr/include/md/_solaris.cfg
@@ -38,34 +38,55 @@
 #ifndef XP_UNIX
 #define XP_UNIX
 #endif
 
 #ifndef SOLARIS
 #define SOLARIS
 #endif
 
-#define PR_AF_INET6 26  /* same as AF_INET6 */
+#if defined(sparc) || defined(__sparc)
 
-#ifdef _LP64
-
-#if defined(sparc) || defined(__sparc)
+#if defined(__sparcv9)
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_DOUBLE  8
+#define IS_64
+#else
+/* we can't check for __sparcv8 because most compilers
+   don't define it by default */
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN 1
 #define PR_ALIGN_OF_INT64   8
 #define PR_ALIGN_OF_DOUBLE  8
-#elif defined(__x86_64)
+#endif
+
+#else
+
+/* not Sparc */
+
+#if defined(__x86_64)
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define PR_ALIGN_OF_INT64   8
 #define PR_ALIGN_OF_DOUBLE  8
+#define IS_64
+#elif defined(i386) || defined(__i386)
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+#define PR_ALIGN_OF_INT64   4
+#define PR_ALIGN_OF_DOUBLE  4
 #else
 #error unknown processor
 #endif
-#define IS_64
+
+#endif
+
+#ifdef IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
 #define PR_BYTES_PER_LONG   8
 #define PR_BYTES_PER_FLOAT  4
 #define PR_BYTES_PER_DOUBLE 8
@@ -93,31 +114,17 @@
 #define PR_BITS_PER_WORD_LOG2   6
 
 #define PR_ALIGN_OF_SHORT   2
 #define PR_ALIGN_OF_INT     4
 #define PR_ALIGN_OF_LONG    8
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_POINTER 8
 
-#else /* _LP64 */
-
-#if defined(sparc) || defined(__sparc)
-#undef  IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#define PR_ALIGN_OF_INT64   8
-#define PR_ALIGN_OF_DOUBLE  8
-#elif defined(i386) || defined(__i386)
-#define IS_LITTLE_ENDIAN 1
-#undef  IS_BIG_ENDIAN
-#define PR_ALIGN_OF_INT64   4
-#define PR_ALIGN_OF_DOUBLE  4
-#else
-#error unknown processor
-#endif
+#else /* IS_64 */
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
 #define PR_BYTES_PER_LONG   4
 #define PR_BYTES_PER_FLOAT  4
 #define PR_BYTES_PER_DOUBLE 8
@@ -145,17 +152,19 @@
 #define PR_BITS_PER_WORD_LOG2   5
 
 #define PR_ALIGN_OF_SHORT   2
 #define PR_ALIGN_OF_INT     4
 #define PR_ALIGN_OF_LONG    4
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_POINTER 4
 
-#endif /* _LP64 */
+#endif /* ifdef IS_64 */
+
+#define PR_AF_INET6 26  /* same as AF_INET6 */
 
 #define	HAVE_LONG_LONG
 #define	HAVE_ALIGNED_DOUBLES
 #define	HAVE_ALIGNED_LONGLONGS
 
 #ifndef NO_NSPR_10_SUPPORT
 
 #define BYTES_PER_BYTE		PR_BYTES_PER_BYTE