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