comparison src/dil/CompilerInfo.d @ 806:bcb74c9b895c

Moved out files in the trunk folder to the root.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 09 Mar 2008 00:12:19 +0100
parents trunk/src/dil/CompilerInfo.d@a7320b7cb7dc
children
comparison
equal deleted inserted replaced
805:a3fab8b74a7d 806:bcb74c9b895c
1 /++
2 Author: Aziz Köksal
3 License: GPL3
4 +/
5 module dil.CompilerInfo;
6
7 version(D2)
8 /// The major version number of this compiler.
9 const uint VERSION_MAJOR = 2;
10 else
11 /// The major version number of this compiler.
12 const uint VERSION_MAJOR = 1;
13
14 /// The minor version number of this compiler.
15 const uint VERSION_MINOR = 0;
16
17 private char[] toString(uint x)
18 {
19 char[] str;
20 do
21 str = cast(char)('0' + (x % 10)) ~ str;
22 while (x /= 10)
23 return str;
24 }
25
26 private char[] toString(uint x, uint pad)
27 {
28 char[] str = toString(x);
29 if (pad < str.length)
30 return str;
31 for (uint i = pad-str.length; i; i--)
32 str = "0" ~ str;
33 return str;
34 }
35
36 /// The compiler version formatted as a string.
37 const char[] VERSION = toString(VERSION_MAJOR)~"."~toString(VERSION_MINOR, 3);
38 /// The name of the compiler.
39 const char[] VENDOR = "dil";
40
41 /// The global, default alignment size for struct fields.
42 const uint DEFAULT_ALIGN_SIZE = 4;
43
44 version(DDoc)
45 const uint PTR_SIZE = 0; /// The pointer size depending on the platform.
46 else
47 version(X86_64)
48 const uint PTR_SIZE = 8; // Pointer size on 64-bit platforms.
49 else
50 const uint PTR_SIZE = 4; // Pointer size on 32-bit platforms.