1*760c2415Smrg // Written in the D programming language.
2*760c2415Smrg 
3*760c2415Smrg /**
4*760c2415Smrg  * Identify the compiler used and its various features.
5*760c2415Smrg  *
6*760c2415Smrg  * Copyright: Copyright Digital Mars 2000 - 2011.
7*760c2415Smrg  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
8*760c2415Smrg  * Authors:   $(HTTP digitalmars.com, Walter Bright), Alex Rønne Petersen
9*760c2415Smrg  * Source:    $(PHOBOSSRC std/_compiler.d)
10*760c2415Smrg  */
11*760c2415Smrg /*          Copyright Digital Mars 2000 - 2011.
12*760c2415Smrg  * Distributed under the Boost Software License, Version 1.0.
13*760c2415Smrg  *    (See accompanying file LICENSE_1_0.txt or copy at
14*760c2415Smrg  *          http://www.boost.org/LICENSE_1_0.txt)
15*760c2415Smrg  */
16*760c2415Smrg module std.compiler;
17*760c2415Smrg 
18*760c2415Smrg immutable
19*760c2415Smrg {
20*760c2415Smrg     /// Vendor specific string naming the compiler, for example: "Digital Mars D".
21*760c2415Smrg     string name = __VENDOR__;
22*760c2415Smrg 
23*760c2415Smrg     /// Master list of D compiler vendors.
24*760c2415Smrg     enum Vendor
25*760c2415Smrg     {
26*760c2415Smrg         unknown = 0,     /// Compiler vendor could not be detected
27*760c2415Smrg         digitalMars = 1, /// Digital Mars D (DMD)
28*760c2415Smrg         gnu = 2,         /// GNU D Compiler (GDC)
29*760c2415Smrg         llvm = 3,        /// LLVM D Compiler (LDC)
30*760c2415Smrg         dotNET = 4,      /// D.NET
31*760c2415Smrg         sdc = 5,         /// Stupid D Compiler (SDC)
32*760c2415Smrg     }
33*760c2415Smrg 
34*760c2415Smrg     /// Which vendor produced this compiler.
35*760c2415Smrg     version (StdDdoc)          Vendor vendor;
36*760c2415Smrg     else version (DigitalMars) Vendor vendor = Vendor.digitalMars;
37*760c2415Smrg     else version (GNU)         Vendor vendor = Vendor.gnu;
38*760c2415Smrg     else version (LDC)         Vendor vendor = Vendor.llvm;
39*760c2415Smrg     else version (D_NET)       Vendor vendor = Vendor.dotNET;
40*760c2415Smrg     else version (SDC)         Vendor vendor = Vendor.sdc;
41*760c2415Smrg     else                      Vendor vendor = Vendor.unknown;
42*760c2415Smrg 
43*760c2415Smrg 
44*760c2415Smrg     /**
45*760c2415Smrg      * The vendor specific version number, as in
46*760c2415Smrg      * version_major.version_minor
47*760c2415Smrg      */
48*760c2415Smrg     uint version_major = __VERSION__ / 1000;
49*760c2415Smrg     uint version_minor = __VERSION__ % 1000;    /// ditto
50*760c2415Smrg 
51*760c2415Smrg 
52*760c2415Smrg     /**
53*760c2415Smrg      * The version of the D Programming Language Specification
54*760c2415Smrg      * supported by the compiler.
55*760c2415Smrg      */
56*760c2415Smrg     uint D_major = 2;
57*760c2415Smrg     uint D_minor = 0;
58*760c2415Smrg }
59