diff options
author | christophe.ravel.bugs%sun.com <devnull@localhost> | 2004-10-22 16:45:03 +0000 |
---|---|---|
committer | christophe.ravel.bugs%sun.com <devnull@localhost> | 2004-10-22 16:45:03 +0000 |
commit | f6b8757bf585d7e7aeca8279991c93e7a4cff8a4 (patch) | |
tree | fde431af9e16074525ad4b0de4a9f397592910d2 | |
parent | 5ab8b13f0ca1917015514735c7f360c7d38667ec (diff) | |
download | nspr-hg-f6b8757bf585d7e7aeca8279991c93e7a4cff8a4.tar.gz |
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
-rw-r--r-- | pr/include/md/_solaris.cfg | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/pr/include/md/_solaris.cfg b/pr/include/md/_solaris.cfg index a0cb768a..c9fc76b7 100644 --- a/pr/include/md/_solaris.cfg +++ b/pr/include/md/_solaris.cfg @@ -43,24 +43,45 @@ #define SOLARIS #endif -#define PR_AF_INET6 26 /* same as AF_INET6 */ - -#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 -#elif defined(__x86_64) +#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 +#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 @@ -98,21 +119,7 @@ #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 @@ -150,7 +157,9 @@ #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 |