Register C++ exception handler correctly for little endian platforms as well as big endian ones.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32608 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2011-03-16 14:38:42 +00:00
parent 84c3d01a61
commit 397d15d8a1

View file

@ -50,10 +50,16 @@ static Class CXXExceptionClass;
// TODO: Add an API for registering other classes for other exception types
static Class boxClass(int64_t foo)
{
// Big endian platforms
if (foo == *(int64_t*)(void*)"GNUCC++\0")
{
return CXXExceptionClass;
}
// Little endian platforms
if (foo == *(int64_t*)(void*)"\0++CCUNG")
{
return CXXExceptionClass;
}
return Nil;
}
+ (void) load