comparison gen/main.cpp @ 999:2b6c2e961f25

Added some missing version identifiers.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 26 Feb 2009 18:28:50 +0100
parents 4f12ec3216cf
children 55051098d9fc
comparison
equal deleted inserted replaced
998:ff22650d0ca3 999:2b6c2e961f25
131 global.params.linkswitches = new Array(); 131 global.params.linkswitches = new Array();
132 global.params.libfiles = new Array(); 132 global.params.libfiles = new Array();
133 global.params.objfiles = new Array(); 133 global.params.objfiles = new Array();
134 global.params.ddocfiles = new Array(); 134 global.params.ddocfiles = new Array();
135 135
136
136 // Set predefined version identifiers 137 // Set predefined version identifiers
137 VersionCondition::addPredefinedGlobalIdent("LLVM"); 138 VersionCondition::addPredefinedGlobalIdent("LLVM");
138 VersionCondition::addPredefinedGlobalIdent("LDC"); 139 VersionCondition::addPredefinedGlobalIdent("LDC");
139 VersionCondition::addPredefinedGlobalIdent("all"); 140 VersionCondition::addPredefinedGlobalIdent("all");
141 #if DMDV2
142 VersionCondition::addPredefinedGlobalIdent("D_Version2");
143 #endif
144
140 145
141 // read the inifile 146 // read the inifile
142 #if DMDV2 147 #if DMDV2
143 inifile(global.params.argv0, "ldc2.conf"); 148 inifile(global.params.argv0, "ldc2.conf");
144 #else 149 #else
440 else { 445 else {
441 VersionCondition::addPredefinedGlobalIdent("BigEndian"); 446 VersionCondition::addPredefinedGlobalIdent("BigEndian");
442 } 447 }
443 448
444 // a generic 64bit version 449 // a generic 64bit version
445 // why isn't this in D to begin with ?
446 if (global.params.is64bit) { 450 if (global.params.is64bit) {
447 VersionCondition::addPredefinedGlobalIdent("LLVM64"); 451 VersionCondition::addPredefinedGlobalIdent("LLVM64");
452 // FIXME: is this always correct?
453 VersionCondition::addPredefinedGlobalIdent("D_LP64");
448 } 454 }
449 455
450 // parse the OS out of the target triple 456 // parse the OS out of the target triple
451 // see http://gcc.gnu.org/install/specific.html for details 457 // see http://gcc.gnu.org/install/specific.html for details
452 // also llvm's different SubTargets have useful information 458 // also llvm's different SubTargets have useful information
505 } 511 }
506 512
507 // added in 1.039 513 // added in 1.039
508 if (global.params.doDocComments) 514 if (global.params.doDocComments)
509 VersionCondition::addPredefinedGlobalIdent("D_Ddoc"); 515 VersionCondition::addPredefinedGlobalIdent("D_Ddoc");
516
517 #if DMDV2
518 // unittests?
519 if (global.params.useUnitTests)
520 VersionCondition::addPredefinedGlobalIdent("unittest");
521 #endif
510 522
511 // Initialization 523 // Initialization
512 Type::init(); 524 Type::init();
513 Id::initialize(); 525 Id::initialize();
514 Module::init(); 526 Module::init();