]> git.llucax.com Git - software/druntime.git/commitdiff
Added "invariant" module to fix link issues because DMD generates references to an...
authorsean <sean@4a9d5153-6564-4b3f-b5e1-7e8e9dac548f>
Tue, 30 Sep 2008 19:50:33 +0000 (19:50 +0000)
committersean <sean@4a9d5153-6564-4b3f-b5e1-7e8e9dac548f>
Tue, 30 Sep 2008 19:50:33 +0000 (19:50 +0000)
git-svn-id: http://svn.dsource.org/projects/druntime/trunk@12 4a9d5153-6564-4b3f-b5e1-7e8e9dac548f

src/compiler/dmd/invariant.d [new file with mode: 0644]
src/compiler/dmd/invariant_.d
src/compiler/dmd/posix.mak
src/compiler/dmd/win32.mak

diff --git a/src/compiler/dmd/invariant.d b/src/compiler/dmd/invariant.d
new file mode 100644 (file)
index 0000000..aad22db
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Placed into the Public Domain
+ * written by Walter Bright
+ * www.digitalmars.com
+ */
+
+void _d_invariant(Object o)
+{   ClassInfo c;
+
+    //printf("__d_invariant(%p)\n", o);
+
+    // BUG: needs to be filename/line of caller, not library routine
+    assert(o !is null); // just do null check, not invariant check
+
+    c = o.classinfo;
+    do
+    {
+        if (c.classInvariant)
+        {
+            (*c.classInvariant)(o);
+        }
+        c = c.base;
+    } while (c);
+}
index f5a3c50398dec0a240f158782a04b475a78c0210..77b12f39848b34fcfd4dc24e6845c715e820abde 100644 (file)
@@ -5,7 +5,7 @@
  */
 module rt.invariant_;
 
-void _d_invariant(Object o)
+extern (C) void _d_invariant(Object o)
 {   ClassInfo c;
 
     //printf("__d_invariant(%p)\n", o);
index 51762be235390779ba40c412f1529ffac6d2e895..7d3f660581338a9f4a38b5db6ee5c6ad593857bf 100644 (file)
@@ -83,6 +83,7 @@ OBJ_BASE= \
     critical.o \\r
     deh2.o \\r
     dmain2.o \\r
+    invariant.o \\r
     invariant_.o \\r
     lifetime.o \\r
     llmath.o \\r
index 0314474affd3aa62d846fcfcff1d159c4aca0030..0c2ea1e6011175ce7593240e8af2c3f231469dcd 100644 (file)
@@ -78,6 +78,7 @@ OBJ_BASE= \
     critical.obj \\r
     deh.obj \\r
     dmain2.obj \\r
+    invariant.obj \\r
     invariant_.obj \\r
     lifetime.obj \\r
     memory.obj \\r