Subject: re: cpp predefines
To: john heasley <heas@shrubbery.net>
From: matthew green <mrg@eterna.com.au>
List: tech-toolchain
Date: 02/05/2003 13:24:20
   could someone tell me how names of platform specific cpp predefines are
   chosen?

largely hysterical raisins.
   
   basically, going through some of the xfree source (from their cvs), they
   have some source that reads:
   
   #ifdef _LP64
   # if defined(__sparcv9)
   #  define       _MACH64_NAME            "sparcv9"
   
   i understand that _LP64 comes from the sysv ABI (right?), but where did
   __sparcv9 come from?  netbsd has __sparc_v9__.  i'm curious if i should
   change the x source or ask toolchain-masters about adding __sparcv9.

possibly we should add __sparcv9 -- it has always been defined in
solaris i think.  as is __sparc_v9__.  (there is also __sparc_v8__ 
for v8.)
   
   guelah [27] gcc -dM -E - < /dev/null
   #define __arch64__ 1 
   #define __sparc64__ 1 
   #define __NetBSD__ 1 
   #define __SIZE_TYPE__ long unsigned int 
   #define __GNUC_MINOR__ 95 
   #define __PTRDIFF_TYPE__ long int 
   #define __sparc_v9__ 1 
   #define __GNUC__ 2 
   #define __sparc__ 1 
   #define __ELF__ 1 
   #define _LP64 1 


i believe that if _LP64 is defined, and __sparc__ is defined, we have
a "sparcv9" machine (what is _MACH64_NAME used for?).


__sparc64__ is the correct predefine to check for sparc64 in the
general case.