Re: [Predef-contribute] Predefined macro updates and fixes
Brought to you by:
breese,
tahonermann
From: Guillem J. <gu...@ha...> - 2012-12-10 11:24:57
|
Hi! I just found the reply on the mailing list archive, please CC me as I'm not subscribed, thanks. The only canonical reference I've found for several of the above, are from source code. On Fri, 2012-11-23 at 19:25:45 +0100, Guillem Jover wrote: > For GNU/kFreeBSD both __FreeBSD_kernel__ && __GLIBC__ should be > checked, because FreeBSD has started defining __FreeBSD_kernel__ > (since FreeBSD 8.3, FreeBSD 9.1 and FreeBSD 10.0 on those branches). __FreeBSD_kernel__ is something we've been defininig in GNU/kFreeBSD since the beginning of the port, Robert Millan recently managed to get FreeBSD upstream to define it too. This can be found in sys/sys/param.h on FreeBSD source repositories. > For GNU/Hurd, __gnu_hurd__ is also defined, and because it's currently > based on the GNU Mach kernel, so is __MACH__. __gnu_hurd__ and __MACH__ are defined by gcc in gcc/config/gnu.h. > The same goes for GNU/Linux, the common check there is __linux__ && > __GLIBC__ instead of __gnu_linux__ (although valid). > To distinguish GNU/* systems in general, just testing for __GLIBC__ > should be enough. This is just standard usage of the glibc macro. > The new ARM64 architecture (officially called with the unfortunate > name of AArch64...), defines the __aarch64__, __AARCH64EB__ and > __AARCH64EL__ macros (the last two for big and little endian variants). The only canonical reference for these that I've found, are the macros defined by gcc in gcc/config/aarch64/aarch64.h, submitted by ARM employees. The ARM64 psABI does not define them, for example. > The new x32 architecture (or different ABI for AMD64, depending how > one looks at it), can be distinguished with __amd64__ && __ILP32__. This is defined in the x32 psABI: <https://sites.google.com/site/x32abi/documents/x32-abi-1.0.pdf?attredirects=0&d=1> The x32 site is <https://sites.google.com/site/x32abi/>. Regards, Guillem |