changeset 566:68d7df3f9b05

Added some sanity checks for target detection.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 31 Aug 2008 18:51:14 +0200
parents 3c07287765bc
children f75b16f1e405
files dmd/mars.c dmd/mars.h
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/mars.c	Sun Aug 31 18:38:16 2008 +0200
+++ b/dmd/mars.c	Sun Aug 31 18:51:14 2008 +0200
@@ -341,6 +341,8 @@
 #error
 #endif /* linux */
 
+    assert(global.params.os != OSinvalid);
+
     //VersionCondition::addPredefinedGlobalIdent("D_Bits");
     VersionCondition::addPredefinedGlobalIdent("all");
 
@@ -767,6 +769,8 @@
         assert(0 && "Invalid arch");
     }
 
+    assert(global.params.cpu != ARCHinvalid);
+
     if (allowForceEndianness && global.params.forceBE) {
         VersionCondition::addPredefinedGlobalIdent("BigEndian");
         global.params.isLE = false;
--- a/dmd/mars.h	Sun Aug 31 18:38:16 2008 +0200
+++ b/dmd/mars.h	Sun Aug 31 18:51:14 2008 +0200
@@ -40,6 +40,7 @@
 // LLVMDC
 enum ARCH
 {
+    ARCHinvalid,
     ARCHx86,
     ARCHx86_64,
     ARCHppc,
@@ -48,6 +49,7 @@
 
 enum OS
 {
+    OSinvalid,
     OSLinux,
     OSWindows,
     OSMacOSX