diff runtime/internal/typeinfo/ti_delegate.d @ 443:44f08170f4ef

Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn. Reworked the LLVMDC specific pragmas.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 01 Aug 2008 00:32:06 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/internal/typeinfo/ti_delegate.d	Fri Aug 01 00:32:06 2008 +0200
@@ -0,0 +1,39 @@
+
+// delegate
+
+module typeinfo.ti_delegate;
+
+alias void delegate(int) dg;
+
+class TypeInfo_D : TypeInfo
+{
+    hash_t getHash(void *p)
+    {   long l = *cast(long *)p;
+
+        return cast(uint)(l + (l >> 32));
+    }
+
+    int equals(void *p1, void *p2)
+    {
+        return *cast(dg *)p1 == *cast(dg *)p2;
+    }
+
+    size_t tsize()
+    {
+        return dg.sizeof;
+    }
+
+    void swap(void *p1, void *p2)
+    {
+        dg t;
+
+        t = *cast(dg *)p1;
+        *cast(dg *)p1 = *cast(dg *)p2;
+        *cast(dg *)p2 = t;
+    }
+
+    uint flags()
+    {
+        return 1;
+    }
+}