Mercurial > projects > ldc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtime/internal/typeinfo/ti_wchar.d Fri Aug 01 00:32:06 2008 +0200 @@ -0,0 +1,43 @@ + +module typeinfo.ti_wchar; + + +class TypeInfo_u : TypeInfo +{ + char[] toString() { return "wchar"; } + + hash_t getHash(void *p) + { + return *cast(wchar *)p; + } + + int equals(void *p1, void *p2) + { + return *cast(wchar *)p1 == *cast(wchar *)p2; + } + + int compare(void *p1, void *p2) + { + return *cast(wchar *)p1 - *cast(wchar *)p2; + } + + size_t tsize() + { + return wchar.sizeof; + } + + void swap(void *p1, void *p2) + { + wchar t; + + t = *cast(wchar *)p1; + *cast(wchar *)p1 = *cast(wchar *)p2; + *cast(wchar *)p2 = t; + } + + void[] init() + { static wchar c; + + return (cast(wchar *)&c)[0 .. 1]; + } +}