Doc Comments /
Version
Difference (last change) (no other diffs, normal page display)
Changed: 94c94,97
* Examples: ![]() |
* Examples: ![]() * DMD versions in ![]() * LDC versions in ![]() * GDC versions in ![]() |
Conditional Compilation
![]() |
|
Messages
Add your comments here...
Extra Predefined Versions
These versions should be predefined:
Compiler Vendors:
- DigitalMars (for
DMD)
- GNU (for
GDC)
- X86 (Intel and AMD 32 bit processors)
- X86_64 (AMD and Intel 64 bit processors)
- AMD64 (AMD 64 bit processors, not an actual D version)
- EM64T (Intel 64-bit extensions, not an actual D version)
- PPC (for PowerPC 32 bit processors)
- PPC64
- SPARC (for
SPARC 32 bit processors)
- SPARC64
Windows (odd spelling)
- Win32 (API)
- Windows 95
- Windows 98
- Windows ME
- Windows NT
- Windows 2000
- Windows XP
- Win64 (64-bit version of Win32 API, not an actual D version)
- Windows XP
- WinFX (managed future API, not an actual D version)
- Windows Vista
- Unix (this version is missing from DMD)
- GNU_BitsPerPointer32 (size_t.sizeof == uint.sizeof)
- GNU_BitsPerPointer64 (size_t.sizeof == ulong.sizeof)
- LittleEndian (least significant byte first, e.g X86)
- BigEndian (most significant first, e.g. PPC)
- none (Never defined)
- all (Always defined)
- D_InlineAsm_X86 (Inline assembler, asm { }, is implemented and the processor is X86)
- D_Coverage (Coverage analyser is implemented and the -cov switch is thrown)
Clarification on setting debug and version in source code
You can set the version and debug from within your source code, but it must be done at the module level. That is, it must be done outside of any function, class or struct definition.
module myapp; version = 6; // legal debug = qwerty; // legalWhen you are setting debug or version levels, each statement overrides any previous statements in the module.void someFunc() { debug = 2; // Error }
class Foo { version = test; // Error }
debug = 2; // Now set to 2. debug = 1; // Now changes from 2 to 1.However, any version or debug levels set from the command line, will only override these statements if the command line value is greater than the level set from within the module. If a file contains ...
debug = 3;but it is compiled with -debug=5 then the debug level is set to 5. However, if it is compiled with -debug=2 then the debug level is set to 3 (from the source file).
Links
Corresponding page in the D Specification
- Examples:
Versioning Category
- DMD versions in
source
- LDC versions in
source
- GDC versions in
source