[Predef-contribute] Predefined macro updates and fixes
Brought to you by:
breese,
tahonermann
From: Guillem J. <gu...@ha...> - 2012-11-23 18:43:34
|
Hi! Here's some corrections and updates: 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). For GNU/Hurd, __gnu_hurd__ is also defined, and because it's currently based on the GNU Mach kernel, so is __MACH__. 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. 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 new x32 architecture (or different ABI for AMD64, depending how one looks at it), can be distinguished with __amd64__ && __ILP32__. Regards, Guillem |