Mercurial > projects > ldc
changeset 909:52dad07846be
Port some LDC1 portability fixes to LDC2. Fixes #196.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 29 Jan 2009 17:19:48 +0100 |
parents | 6690a1468c17 |
children | 4c02b41b3dc6 |
files | dmd/mars.c dmd2/mars.c dmd2/mars.h |
diffstat | 3 files changed, 26 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/dmd/mars.c Thu Jan 29 16:56:48 2009 +0100 +++ b/dmd/mars.c Thu Jan 29 17:19:48 2009 +0100 @@ -926,18 +926,18 @@ case OSMacOSX: VersionCondition::addPredefinedGlobalIdent("darwin"); - VersionCondition::addPredefinedGlobalIdent("Posix"); - break; + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; case OSFreeBSD: - VersionCondition::addPredefinedGlobalIdent("freebsd"); - VersionCondition::addPredefinedGlobalIdent("Posix"); - break; + VersionCondition::addPredefinedGlobalIdent("freebsd"); + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; case OSSolaris: - VersionCondition::addPredefinedGlobalIdent("solaris"); - VersionCondition::addPredefinedGlobalIdent("Posix"); - break; + VersionCondition::addPredefinedGlobalIdent("solaris"); + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; default: assert(false && "Target OS not supported");
--- a/dmd2/mars.c Thu Jan 29 16:56:48 2009 +0100 +++ b/dmd2/mars.c Thu Jan 29 17:19:48 2009 +0100 @@ -190,7 +190,7 @@ -m<arch> emit code specific to <arch> being one of:\n\ x86 x86-64 ppc32 ppc64 arm thumb\n\ -t<os> emit code specific to <os> being one of:\n\ - Linux, Windows, MacOSX, FreeBSD\n\ + Linux, Windows, MacOSX, FreeBSD, Solaris\n\ \n\ -g, -gc add symbolic debug info\n\ \n\ @@ -343,6 +343,9 @@ global.params.os = OSMacOSX; #elif __FreeBSD__ global.params.os = OSFreeBSD; +#elif defined (__SVR4) && defined (__sun) + global.params.os = OSSolaris; +#else #else #error Unsupported OS #endif /* linux */ @@ -711,6 +714,8 @@ global.params.os = OSMacOSX; else if(strcmp(p + 2, "FreeBSD") == 0) global.params.os = OSFreeBSD; + else if(strcmp(p + 2, "Solaris") == 0) + global.params.os = OSSolaris; else error("unrecognized target os '%s'", p + 2); } @@ -945,13 +950,18 @@ case OSMacOSX: VersionCondition::addPredefinedGlobalIdent("darwin"); - VersionCondition::addPredefinedGlobalIdent("Posix"); - break; + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; case OSFreeBSD: - VersionCondition::addPredefinedGlobalIdent("freebsd"); - VersionCondition::addPredefinedGlobalIdent("Posix"); - break; + VersionCondition::addPredefinedGlobalIdent("freebsd"); + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; + + case OSSolaris: + VersionCondition::addPredefinedGlobalIdent("solaris"); + VersionCondition::addPredefinedGlobalIdent("Posix"); + break; default: assert(false && "Target OS not supported");