Skip to content

Commit

Permalink
Merge pull request #161 from IgniteInteractiveStudio/master
Browse files Browse the repository at this point in the history
Make std.compiler able to detect LDC and GDC.
  • Loading branch information
dsimcha committed Jul 30, 2011
2 parents 7311a6f + 323e3c8 commit a999123
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions std/compiler.d
Expand Up @@ -18,19 +18,37 @@
*/
module std.compiler;

const
immutable
{
/// Vendor specific string naming the compiler, for example: "Digital Mars D".
string name = __VENDOR__;

/// Master list of D compiler vendors.
enum Vendor
{
DigitalMars = 1, /// Digital Mars
Unknown = 0, /// Compiler vendor could not be detected
DigitalMars = 1, /// Digital Mars D (DMD)
GNU = 2, /// GNU D Compiler (GDC)
LLVM = 3, /// LLVM D Compiler (LDC)
}

/// Which vendor produced this compiler.
Vendor vendor = Vendor.DigitalMars;
version (DigitalMars)
{
Vendor vendor = Vendor.DigitalMars;
}
else version (GNU)
{
Vendor vendor = Vendor.GNU;
}
else version (LDC)
{
Vendor vendor = Vendor.LLVM;
}
else
{
Vendor vendor = Vendor.Unknown;
}


/**
Expand Down

0 comments on commit a999123

Please sign in to comment.