Mercurial > projects > ldc
comparison tango/lib/compiler/llvmdc/typeinfo/ti_wchar.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
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 } |