Mercurial > projects > ldc
comparison dmd2/mars.c @ 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 | 82ad6c0c601c |
children | 1d9fe5e2a13c |
comparison
equal
deleted
inserted
replaced
908:6690a1468c17 | 909:52dad07846be |
---|---|
188 \n\ | 188 \n\ |
189 Codegen control:\n\ | 189 Codegen control:\n\ |
190 -m<arch> emit code specific to <arch> being one of:\n\ | 190 -m<arch> emit code specific to <arch> being one of:\n\ |
191 x86 x86-64 ppc32 ppc64 arm thumb\n\ | 191 x86 x86-64 ppc32 ppc64 arm thumb\n\ |
192 -t<os> emit code specific to <os> being one of:\n\ | 192 -t<os> emit code specific to <os> being one of:\n\ |
193 Linux, Windows, MacOSX, FreeBSD\n\ | 193 Linux, Windows, MacOSX, FreeBSD, Solaris\n\ |
194 \n\ | 194 \n\ |
195 -g, -gc add symbolic debug info\n\ | 195 -g, -gc add symbolic debug info\n\ |
196 \n\ | 196 \n\ |
197 -O optimize, same as -O2\n\ | 197 -O optimize, same as -O2\n\ |
198 -O<n> optimize at level <n> (0-5)\n\ | 198 -O<n> optimize at level <n> (0-5)\n\ |
341 global.params.os = OSLinux; | 341 global.params.os = OSLinux; |
342 #elif __APPLE__ | 342 #elif __APPLE__ |
343 global.params.os = OSMacOSX; | 343 global.params.os = OSMacOSX; |
344 #elif __FreeBSD__ | 344 #elif __FreeBSD__ |
345 global.params.os = OSFreeBSD; | 345 global.params.os = OSFreeBSD; |
346 #elif defined (__SVR4) && defined (__sun) | |
347 global.params.os = OSSolaris; | |
348 #else | |
346 #else | 349 #else |
347 #error Unsupported OS | 350 #error Unsupported OS |
348 #endif /* linux */ | 351 #endif /* linux */ |
349 | 352 |
350 assert(global.params.os != OSinvalid); | 353 assert(global.params.os != OSinvalid); |
709 global.params.os = OSWindows; | 712 global.params.os = OSWindows; |
710 else if(strcmp(p + 2, "MacOSX") == 0) | 713 else if(strcmp(p + 2, "MacOSX") == 0) |
711 global.params.os = OSMacOSX; | 714 global.params.os = OSMacOSX; |
712 else if(strcmp(p + 2, "FreeBSD") == 0) | 715 else if(strcmp(p + 2, "FreeBSD") == 0) |
713 global.params.os = OSFreeBSD; | 716 global.params.os = OSFreeBSD; |
717 else if(strcmp(p + 2, "Solaris") == 0) | |
718 global.params.os = OSSolaris; | |
714 else | 719 else |
715 error("unrecognized target os '%s'", p + 2); | 720 error("unrecognized target os '%s'", p + 2); |
716 } | 721 } |
717 else | 722 else |
718 { | 723 { |
943 VersionCondition::addPredefinedGlobalIdent("Posix"); | 948 VersionCondition::addPredefinedGlobalIdent("Posix"); |
944 break; | 949 break; |
945 | 950 |
946 case OSMacOSX: | 951 case OSMacOSX: |
947 VersionCondition::addPredefinedGlobalIdent("darwin"); | 952 VersionCondition::addPredefinedGlobalIdent("darwin"); |
948 VersionCondition::addPredefinedGlobalIdent("Posix"); | 953 VersionCondition::addPredefinedGlobalIdent("Posix"); |
949 break; | 954 break; |
950 | 955 |
951 case OSFreeBSD: | 956 case OSFreeBSD: |
952 VersionCondition::addPredefinedGlobalIdent("freebsd"); | 957 VersionCondition::addPredefinedGlobalIdent("freebsd"); |
953 VersionCondition::addPredefinedGlobalIdent("Posix"); | 958 VersionCondition::addPredefinedGlobalIdent("Posix"); |
954 break; | 959 break; |
960 | |
961 case OSSolaris: | |
962 VersionCondition::addPredefinedGlobalIdent("solaris"); | |
963 VersionCondition::addPredefinedGlobalIdent("Posix"); | |
964 break; | |
955 | 965 |
956 default: | 966 default: |
957 assert(false && "Target OS not supported"); | 967 assert(false && "Target OS not supported"); |
958 } | 968 } |
959 | 969 |