mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Get rid of obsolete CppRuntime_DigitalMars special cases
This commit is contained in:
parent
f08bbff91f
commit
01c9c22f3f
10 changed files with 24 additions and 136 deletions
|
@ -8,7 +8,6 @@
|
|||
import core.stdc.stdio;
|
||||
|
||||
version (CppRuntime_Clang) version = CppMangle_Itanium;
|
||||
version (CppRuntime_DigitalMars) version = CppMangle_MSVC;
|
||||
version (CppRuntime_Gcc) version = CppMangle_Itanium;
|
||||
version (CppRuntime_Microsoft) version = CppMangle_MSVC;
|
||||
version (CppRuntime_Sun) version = CppMangle_Itanium;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
module cppmangle3;
|
||||
|
||||
version (CppRuntime_Clang) version = CppMangle_Itanium;
|
||||
version (CppRuntime_DigitalMars) version = CppMangle_MSVC;
|
||||
version (CppRuntime_Gcc) version = CppMangle_Itanium;
|
||||
version (CppRuntime_Microsoft) version = CppMangle_MSVC;
|
||||
version (CppRuntime_Sun) version = CppMangle_Itanium;
|
||||
|
|
|
@ -53,19 +53,6 @@ version (CppRuntime_Microsoft)
|
|||
enum __delete_mangle = "??3@YAXPAX@Z";
|
||||
}
|
||||
}
|
||||
else version (CppRuntime_DigitalMars)
|
||||
{
|
||||
version (D_LP64)
|
||||
{
|
||||
enum __new_mangle = "??2@YAPEAX_K@Z";
|
||||
enum __delete_mangle = "??3@YAXPEAX@Z";
|
||||
}
|
||||
else
|
||||
{
|
||||
enum __new_mangle = "??2@YAPAXI@Z";
|
||||
enum __delete_mangle = "??3@YAXPAX@Z";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
version (D_LP64)
|
||||
|
|
|
@ -272,7 +272,6 @@ void main()
|
|||
foreach(byte val; values!byte()) check(val);
|
||||
foreach(ubyte val; values!ubyte()) check(val);
|
||||
foreach(char val; values!char()) check(val);
|
||||
version(CppRuntime_DigitalMars){} else
|
||||
version(CppRuntime_Microsoft)
|
||||
{
|
||||
// TODO: figure out how to detect VS2013 which doesn't support char16_t/char32_t
|
||||
|
|
|
@ -908,9 +908,7 @@ void fuzz2()
|
|||
}
|
||||
|
||||
////////
|
||||
version(CppRuntime_DigitalMars)
|
||||
enum UNICODE = false;
|
||||
else version(CppRuntime_Microsoft)
|
||||
version(CppRuntime_Microsoft)
|
||||
enum UNICODE = false; //VS2013 doesn't support them
|
||||
else
|
||||
enum UNICODE = true;
|
||||
|
|
|
@ -239,38 +239,30 @@ void test39()
|
|||
|
||||
extern(C++, "foo", "bar", "baz") int doStuff(int);
|
||||
|
||||
version(CppRuntime_DigitalMars) // DMC doesn't support c++11
|
||||
void test40();
|
||||
|
||||
void foovargs(T...)(T args)
|
||||
{
|
||||
void test40() {}
|
||||
void test41() {}
|
||||
static if (is(T[0] == char*))
|
||||
{
|
||||
assert(*args[0] == 'a');
|
||||
}
|
||||
else
|
||||
{
|
||||
float ret = args[0] + args[1];
|
||||
assert(ret == 3.0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
alias FooVargs = foovargs!(int, float);
|
||||
alias FooVargs2 = foovargs!(char*);
|
||||
|
||||
void test41();
|
||||
void make_shared_poc(T, Args...)(ref Args args)
|
||||
{
|
||||
void test40();
|
||||
|
||||
void foovargs(T...)(T args)
|
||||
{
|
||||
static if (is(T[0] == char*))
|
||||
{
|
||||
assert(*args[0] == 'a');
|
||||
}
|
||||
else
|
||||
{
|
||||
float ret = args[0] + args[1];
|
||||
assert(ret == 3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
alias FooVargs = foovargs!(int, float);
|
||||
alias FooVargs2 = foovargs!(char*);
|
||||
|
||||
void test41();
|
||||
void make_shared_poc(T, Args...)(ref Args args)
|
||||
{
|
||||
assert(args[0] + args[1] == 3);
|
||||
}
|
||||
alias Make_Shared_Poc = make_shared_poc!(int, int, int);
|
||||
assert(args[0] + args[1] == 3);
|
||||
}
|
||||
alias Make_Shared_Poc = make_shared_poc!(int, int, int);
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
|
@ -13,17 +13,6 @@ module core.stdcpp.array;
|
|||
|
||||
import core.stdcpp.xutility : StdNamespace;
|
||||
|
||||
// hacks to support DMD on Win32
|
||||
version (CppRuntime_Microsoft)
|
||||
{
|
||||
version = CppRuntime_Windows; // use the MS runtime ABI for win32
|
||||
}
|
||||
else version (CppRuntime_DigitalMars)
|
||||
{
|
||||
version = CppRuntime_Windows; // use the MS runtime ABI for win32
|
||||
pragma(msg, "std::array not supported by DMC");
|
||||
}
|
||||
|
||||
extern(C++, (StdNamespace)):
|
||||
|
||||
/**
|
||||
|
@ -73,7 +62,7 @@ pure nothrow @nogc:
|
|||
///
|
||||
ref inout(T) back() inout @safe { static if (N > 0) { return this[N-1]; } else { return as_array()[][0]; /* HACK: force OOB */ } }
|
||||
|
||||
version (CppRuntime_Windows)
|
||||
version (CppRuntime_Microsoft)
|
||||
{
|
||||
///
|
||||
inout(T)* data() inout @safe { return &_Elems[0]; }
|
||||
|
|
|
@ -80,24 +80,6 @@ version (GenericBaseException)
|
|||
extern(D) this(const(char)*, int = 1) nothrow { this(); } // compat with MS derived classes
|
||||
}
|
||||
}
|
||||
else version (CppRuntime_DigitalMars)
|
||||
{
|
||||
///
|
||||
class exception
|
||||
{
|
||||
@nogc:
|
||||
///
|
||||
extern(D) this() nothrow {}
|
||||
//virtual ~this();
|
||||
void dtor() { } // reserve slot in vtbl[]
|
||||
|
||||
///
|
||||
const(char)* what() const nothrow;
|
||||
|
||||
protected:
|
||||
this(const(char)*, int = 1) nothrow { this(); } // compat with MS derived classes
|
||||
}
|
||||
}
|
||||
else version (CppRuntime_Microsoft)
|
||||
{
|
||||
///
|
||||
|
|
|
@ -14,17 +14,6 @@ module core.stdcpp.string_view;
|
|||
import core.stdc.stddef : wchar_t;
|
||||
import core.stdcpp.xutility : StdNamespace;
|
||||
|
||||
// hacks to support DMD on Win32
|
||||
version (CppRuntime_Microsoft)
|
||||
{
|
||||
version = CppRuntime_Windows; // use the MS runtime ABI for win32
|
||||
}
|
||||
else version (CppRuntime_DigitalMars)
|
||||
{
|
||||
version = CppRuntime_Windows; // use the MS runtime ABI for win32
|
||||
pragma(msg, "std::basic_string_view not supported by DMC");
|
||||
}
|
||||
|
||||
extern(C++, (StdNamespace)):
|
||||
@nogc:
|
||||
|
||||
|
@ -102,7 +91,7 @@ pure nothrow @nogc:
|
|||
|
||||
private:
|
||||
// use the proper field names from C++ so debugging doesn't get weird
|
||||
version (CppRuntime_Windows)
|
||||
version (CppRuntime_Microsoft)
|
||||
{
|
||||
const_pointer _Mydata;
|
||||
size_type _Mysize;
|
||||
|
|
|
@ -13,53 +13,7 @@ module core.stdcpp.typeinfo;
|
|||
|
||||
import core.attribute : weak;
|
||||
|
||||
version (CppRuntime_DigitalMars)
|
||||
{
|
||||
import core.stdcpp.exception;
|
||||
|
||||
extern (C++, "std"):
|
||||
|
||||
class type_info
|
||||
{
|
||||
@nogc:
|
||||
void* pdata;
|
||||
|
||||
public:
|
||||
//virtual ~this();
|
||||
void dtor() { } // reserve slot in vtbl[]
|
||||
|
||||
//bool operator==(const type_info rhs) const;
|
||||
//bool operator!=(const type_info rhs) const;
|
||||
final bool before(const type_info rhs) const nothrow;
|
||||
final const(char)* name() const nothrow;
|
||||
protected:
|
||||
//type_info();
|
||||
private:
|
||||
//this(const type_info rhs);
|
||||
//type_info operator=(const type_info rhs);
|
||||
}
|
||||
|
||||
class bad_cast : exception
|
||||
{
|
||||
@nogc:
|
||||
extern(D) this() nothrow { }
|
||||
extern(D) this(const bad_cast) nothrow { }
|
||||
//bad_cast operator=(const bad_cast) nothrow { return this; }
|
||||
//virtual ~this() nothrow;
|
||||
override const(char)* what() const nothrow;
|
||||
}
|
||||
|
||||
class bad_typeid : exception
|
||||
{
|
||||
@nogc:
|
||||
extern(D) this() nothrow { }
|
||||
extern(D) this(const bad_typeid) nothrow { }
|
||||
//bad_typeid operator=(const bad_typeid) nothrow { return this; }
|
||||
//virtual ~this() nothrow;
|
||||
override const (char)* what() const nothrow;
|
||||
}
|
||||
}
|
||||
else version (CppRuntime_Microsoft)
|
||||
version (CppRuntime_Microsoft)
|
||||
{
|
||||
import core.stdcpp.exception;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue