Mercurial > projects > dil
annotate trunk/src/dil/CompilerInfo.d @ 629:d050e211402b
Moved files in src/std/ to src/util/.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Fri, 11 Jan 2008 20:03:46 +0100 |
parents | a3f66502ea64 |
children | 3b34f6a95a27 |
rev | line source |
---|---|
465
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
1 /++ |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
2 Author: Aziz Köksal |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
3 License: GPL3 |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
4 +/ |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
5 module dil.CompilerInfo; |
629
d050e211402b
Moved files in src/std/ to src/util/.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
525
diff
changeset
|
6 import util.metastrings : FormatT = Format, ToString; |
465
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
7 |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
8 template Pad(char[] str, uint amount) |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
9 { |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
10 static if (str.length >= amount) |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
11 const char[] Pad = str; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
12 else |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
13 const char[] Pad = "0" ~ Pad!(str, amount-1); |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
14 } |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
15 |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
16 template Pad(int num, uint amount) |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
17 { |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
18 const char[] Pad = Pad!(ToString!(num), amount); |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
19 } |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
20 |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
21 version(D2) |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
22 { |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
23 const VERSION_MAJOR = 2; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
24 const VERSION_MINOR = 0; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
25 } |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
26 else |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
27 { |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
28 const VERSION_MAJOR = 1; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
29 const VERSION_MINOR = 0; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
30 } |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
31 |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
32 const VERSION = FormatT!("%s.%s", VERSION_MAJOR, Pad!(VERSION_MINOR, 3)); |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
33 const VENDOR = "dil"; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
34 |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
35 /// Used in main help message. |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
36 const COMPILED_WITH = __VENDOR__; |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
37 /// ditto |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
38 const COMPILED_VERSION = FormatT!("%s.%s", __VERSION__/1000, Pad!(__VERSION__%1000, 3)); |
e0d24e05a9ee
Forgot to add the new module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff
changeset
|
39 /// ditto |
495
b60450804b6e
Attributes are evaluated during the parsing phase now.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
465
diff
changeset
|
40 const COMPILED_DATE = __TIMESTAMP__; |
b60450804b6e
Attributes are evaluated during the parsing phase now.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
465
diff
changeset
|
41 |
513
6160ab7b1816
Refactored code related to settings.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
495
diff
changeset
|
42 /// The global, default alignment size for struct fields. |
6160ab7b1816
Refactored code related to settings.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
495
diff
changeset
|
43 const DEFAULT_ALIGN_SIZE = 4; |
525
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
44 |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
45 version(X86_64) |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
46 { |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
47 const PTR_SIZE = 8; /// Pointer size on 64-bit platforms. |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
48 } |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
49 else |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
50 { |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
51 const PTR_SIZE = 4; /// Pointer size on 32-bit platforms. |
a3f66502ea64
Added struct Types with pre-defined types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
513
diff
changeset
|
52 } |