Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
442:76078c8ab5b9 | 443:44f08170f4ef |
---|---|
1 | |
2 // delegate | |
3 | |
4 module typeinfo.ti_delegate; | |
5 | |
6 alias void delegate(int) dg; | |
7 | |
8 class TypeInfo_D : TypeInfo | |
9 { | |
10 hash_t getHash(void *p) | |
11 { long l = *cast(long *)p; | |
12 | |
13 return cast(uint)(l + (l >> 32)); | |
14 } | |
15 | |
16 int equals(void *p1, void *p2) | |
17 { | |
18 return *cast(dg *)p1 == *cast(dg *)p2; | |
19 } | |
20 | |
21 size_t tsize() | |
22 { | |
23 return dg.sizeof; | |
24 } | |
25 | |
26 void swap(void *p1, void *p2) | |
27 { | |
28 dg t; | |
29 | |
30 t = *cast(dg *)p1; | |
31 *cast(dg *)p1 = *cast(dg *)p2; | |
32 *cast(dg *)p2 = t; | |
33 } | |
34 | |
35 uint flags() | |
36 { | |
37 return 1; | |
38 } | |
39 } |