Mercurial > projects > ldc
comparison runtime/internal/typeinfo/ti_wchar.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 module typeinfo.ti_wchar; | |
3 | |
4 | |
5 class TypeInfo_u : TypeInfo | |
6 { | |
7 char[] toString() { return "wchar"; } | |
8 | |
9 hash_t getHash(void *p) | |
10 { | |
11 return *cast(wchar *)p; | |
12 } | |
13 | |
14 int equals(void *p1, void *p2) | |
15 { | |
16 return *cast(wchar *)p1 == *cast(wchar *)p2; | |
17 } | |
18 | |
19 int compare(void *p1, void *p2) | |
20 { | |
21 return *cast(wchar *)p1 - *cast(wchar *)p2; | |
22 } | |
23 | |
24 size_t tsize() | |
25 { | |
26 return wchar.sizeof; | |
27 } | |
28 | |
29 void swap(void *p1, void *p2) | |
30 { | |
31 wchar t; | |
32 | |
33 t = *cast(wchar *)p1; | |
34 *cast(wchar *)p1 = *cast(wchar *)p2; | |
35 *cast(wchar *)p2 = t; | |
36 } | |
37 | |
38 void[] init() | |
39 { static wchar c; | |
40 | |
41 return (cast(wchar *)&c)[0 .. 1]; | |
42 } | |
43 } |