# DP: Implements D OS version conditions. This implements the following official versions: * Windows ** Win32 ** Win64 ** Cygwin ** MinGW * linux * OSX * FreeBSD * OpenBSD * NetBSD * Solaris * Posix * AIX * SysV4 * Hurd * Android These gdc specific versions are also implemented: * GNU_MinGW64 (for mingw-w64) * GNU_OpenSolaris (for opensolaris) * GNU_GLibc (implemented for linux & bsd & opensolaris) * GNU_UCLibc (implemented for linux) * GNU_Bionic (implemented for linux) These official OS versions are not implemented: * DragonFlyBSD * BSD (other BSDs) * Haiku * SkyOS * SysV3 Index: b/src/gcc/config/alpha/linux.h =================================================================== --- a/src/gcc/config/alpha/linux.h +++ b/src/gcc/config/alpha/linux.h @@ -33,6 +33,16 @@ along with GCC; see the file COPYING3. builtin_define ("_GNU_SOURCE"); \ } while (0) +#undef TARGET_OS_D_BUILTINS +#define TARGET_OS_D_BUILTINS() \ + do { \ + if (OPTION_GLIBC) \ + builtin_define ("GNU_GLibc"); \ + \ + builtin_define ("linux"); \ + builtin_define ("Posix"); \ + } while (0) + #undef LIB_SPEC #define LIB_SPEC \ "%{pthread:-lpthread} \ Index: b/src/gcc/config/arm/linux-eabi.h =================================================================== --- a/src/gcc/config/arm/linux-eabi.h +++ b/src/gcc/config/arm/linux-eabi.h @@ -30,6 +30,15 @@ } \ while (false) +#undef TARGET_OS_D_BUILTINS +#define TARGET_OS_D_BUILTINS() \ + do \ + { \ + TARGET_GENERIC_LINUX_OS_D_BUILTINS(); \ + ANDROID_TARGET_OS_D_BUILTINS(); \ + } \ + while (false) + /* We default to a soft-float ABI so that binaries can run on all target hardware. If you override this to use the hard-float ABI then change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */ Index: b/src/gcc/config/darwin.h =================================================================== --- a/src/gcc/config/darwin.h +++ b/src/gcc/config/darwin.h @@ -977,4 +977,10 @@ extern void darwin_driver_init (unsigned #define DEF_LD64 LD64_VERSION #endif +#define TARGET_OS_D_BUILTINS() \ + do { \ + builtin_define ("OSX"); \ + builtin_define ("Posix"); \ + } while (0) + #endif /* CONFIG_DARWIN_H */ Index: b/src/gcc/config/freebsd.h =================================================================== --- a/src/gcc/config/freebsd.h +++ b/src/gcc/config/freebsd.h @@ -32,6 +32,13 @@ along with GCC; see the file COPYING3. #undef TARGET_OS_CPP_BUILTINS #define TARGET_OS_CPP_BUILTINS() FBSD_TARGET_OS_CPP_BUILTINS() +#undef TARGET_OS_D_BUILTINS +#define TARGET_OS_D_BUILTINS() \ + do { \ + builtin_define ("FreeBSD"); \ + builtin_define ("Posix"); \ + } while (0) + #undef CPP_SPEC #define CPP_SPEC FBSD_CPP_SPEC Index: b/src/gcc/config/gnu.h =================================================================== --- a/src/gcc/config/gnu.h +++ b/src/gcc/config/gnu.h @@ -31,3 +31,11 @@ along with GCC. If not, see