[pkg-d-commits] [ldc] 81/95: Fix compilation error with DMD 2.074 (#2068)
Matthias Klumpp
mak at moszumanska.debian.org
Thu Jul 13 20:54:03 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.3.0-beta1
in repository ldc.
commit 452c5ab4f1a1c111ad11670792c64ce38d64196f
Author: kinke <kinke at users.noreply.github.com>
Date: Tue Apr 11 01:24:10 2017 +0200
Fix compilation error with DMD 2.074 (#2068)
Cherry-picking dlang/dmd at ae97f7b and dlang/dmd at 5b73a2c.
---
ddmd/root/rmem.d | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/ddmd/root/rmem.d b/ddmd/root/rmem.d
index d4d25d6..7daf69c 100644
--- a/ddmd/root/rmem.d
+++ b/ddmd/root/rmem.d
@@ -189,8 +189,8 @@ else
extern (C) Object _d_newclass(const ClassInfo ci) nothrow
{
- auto p = allocmemory(ci.init.length);
- p[0 .. ci.init.length] = cast(void[])ci.init[];
+ auto p = allocmemory(ci.initializer.length);
+ p[0 .. ci.initializer.length] = cast(void[])ci.initializer[];
return cast(Object)p;
}
@@ -198,23 +198,31 @@ else
{
extern (C) Object _d_allocclass(const ClassInfo ci) nothrow
{
- return cast(Object)allocmemory(ci.init.length);
+ return cast(Object)allocmemory(ci.initializer.length);
}
}
extern (C) void* _d_newitemT(TypeInfo ti) nothrow
{
auto p = allocmemory(ti.tsize);
- (cast(ubyte*)p)[0 .. ti.init.length] = 0;
+ (cast(ubyte*)p)[0 .. ti.initializer.length] = 0;
return p;
}
extern (C) void* _d_newitemiT(TypeInfo ti) nothrow
{
auto p = allocmemory(ti.tsize);
- p[0 .. ti.init.length] = ti.init[];
+ p[0 .. ti.initializer.length] = ti.initializer[];
return p;
}
+
+ // TypeInfo.initializer for compilers older than 2.070
+ static if(!__traits(hasMember, TypeInfo, "initializer"))
+ private const(void[]) initializer(T : TypeInfo)(const T t)
+ nothrow pure @safe @nogc
+ {
+ return t.init;
+ }
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git
More information about the pkg-d-commits
mailing list