diff -ruN ldc-0.13.0.orig/dmd2/root/man.c ldc-0.13.0/dmd2/root/man.c --- ldc-0.13.0.orig/dmd2/root/man.c 2014-02-10 12:08:36.000000000 +0000 +++ ldc-0.13.0/dmd2/root/man.c 2014-07-15 10:12:04.000000000 +0000 @@ -26,7 +26,7 @@ #endif -#if __linux__ || __FreeBSD__ || __OpenBSD__ || __sun +#if __linux__ || __FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__ || __sun #include #include diff -ruN ldc-0.13.0.orig/dmd2/root/port.c ldc-0.13.0/dmd2/root/port.c --- ldc-0.13.0.orig/dmd2/root/port.c 2014-05-10 13:47:06.000000000 +0000 +++ ldc-0.13.0/dmd2/root/port.c 2014-07-15 10:10:03.000000000 +0000 @@ -432,10 +432,10 @@ #endif -#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __HAIKU__ +#if __linux__ || __APPLE__ || __FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__ || __HAIKU__ #include -#if __linux__ +#if __linux__ || __GLIBC__ #include #include #endif diff -ruN ldc-0.13.0.orig/driver/main.cpp ldc-0.13.0/driver/main.cpp --- ldc-0.13.0.orig/driver/main.cpp 2014-06-23 16:27:55.000000000 +0000 +++ ldc-0.13.0/driver/main.cpp 2014-07-15 10:42:18.000000000 +0000 @@ -693,6 +693,11 @@ VersionCondition::addPredefinedGlobalIdent("FreeBSD"); VersionCondition::addPredefinedGlobalIdent("Posix"); break; + case llvm::Triple::KFreeBSD: + VersionCondition::addPredefinedGlobalIdent("freebsd"); // For backwards compatibility. + VersionCondition::addPredefinedGlobalIdent("FreeBSD"); + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; case llvm::Triple::Solaris: VersionCondition::addPredefinedGlobalIdent("solaris"); // For backwards compatibility. VersionCondition::addPredefinedGlobalIdent("Solaris");