changeset 465:e0d24e05a9ee

Forgot to add the new module.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 30 Oct 2007 20:27:24 +0100
parents 325714d8aa6c
children db7e27b5c180
files trunk/src/dil/CompilerInfo.d
diffstat 1 files changed, 40 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/src/dil/CompilerInfo.d	Tue Oct 30 20:27:24 2007 +0100
@@ -0,0 +1,40 @@
+/++
+  Author: Aziz Köksal
+  License: GPL3
++/
+module dil.CompilerInfo;
+import std.metastrings : FormatT = Format, ToString;
+
+template Pad(char[] str, uint amount)
+{
+  static if (str.length >= amount)
+    const char[] Pad = str;
+  else
+    const char[] Pad = "0" ~ Pad!(str, amount-1);
+}
+
+template Pad(int num, uint amount)
+{
+  const char[] Pad = Pad!(ToString!(num), amount);
+}
+
+version(D2)
+{
+  const VERSION_MAJOR = 2;
+  const VERSION_MINOR = 0;
+}
+else
+{
+  const VERSION_MAJOR = 1;
+  const VERSION_MINOR = 0;
+}
+
+const VERSION = FormatT!("%s.%s", VERSION_MAJOR, Pad!(VERSION_MINOR, 3));
+const VENDOR = "dil";
+
+/// Used in main help message.
+const COMPILED_WITH = __VENDOR__;
+/// ditto
+const COMPILED_VERSION = FormatT!("%s.%s", __VERSION__/1000, Pad!(__VERSION__%1000, 3));
+/// ditto
+const COMPILED_DATE = __TIMESTAMP__;
\ No newline at end of file