view lphobos/typeinfo1/ti_short.d @ 285:297690b5d4a5 trunk

[svn r306] Fixed: it's now possible to compile and link llvmdc with MinGW32 and msys on Win32 :D I tried it myself ;) Building the runtime still needs some work, but it's a step in the right direction.
author lindquist
date Sat, 21 Jun 2008 03:14:49 +0200
parents 2c3cd3596187
children
line wrap: on
line source


// short

module typeinfo1.ti_short;

class TypeInfo_s : TypeInfo
{
    char[] toString() { return "short"; }

    hash_t getHash(void *p)
    {
	return *cast(short *)p;
    }

    int equals(void *p1, void *p2)
    {
	return *cast(short *)p1 == *cast(short *)p2;
    }

    int compare(void *p1, void *p2)
    {
	return *cast(short *)p1 - *cast(short *)p2;
    }

    size_t tsize()
    {
	return short.sizeof;
    }

    void swap(void *p1, void *p2)
    {
	short t;

	t = *cast(short *)p1;
	*cast(short *)p1 = *cast(short *)p2;
	*cast(short *)p2 = t;
    }
}