Mercurial > projects > ldc
diff runtime/internal/typeinfo/ti_ulong.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_ulong.d Fri Aug 01 00:32:06 2008 +0200 @@ -0,0 +1,43 @@ + +// ulong + +module typeinfo.ti_ulong; + +class TypeInfo_m : TypeInfo +{ + char[] toString() { return "ulong"; } + + hash_t getHash(void *p) + { + return *cast(uint *)p + (cast(uint *)p)[1]; + } + + int equals(void *p1, void *p2) + { + return *cast(ulong *)p1 == *cast(ulong *)p2; + } + + int compare(void *p1, void *p2) + { + if (*cast(ulong *)p1 < *cast(ulong *)p2) + return -1; + else if (*cast(ulong *)p1 > *cast(ulong *)p2) + return 1; + return 0; + } + + size_t tsize() + { + return ulong.sizeof; + } + + void swap(void *p1, void *p2) + { + ulong t; + + t = *cast(ulong *)p1; + *cast(ulong *)p1 = *cast(ulong *)p2; + *cast(ulong *)p2 = t; + } +} +