Attempt to resolve decoding issues on 64bit systems.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21501 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-07-18 10:12:49 +00:00
parent 2dc1962a6b
commit dcb3070d9c
3 changed files with 60 additions and 0 deletions

View file

@ -234,6 +234,32 @@ typeCheck(char t1, char t2)
{
if (type_map[(t2 & _GSC_MASK)] != t1)
{
/*
* HACK ... allow int/long/longlong types to be used interchangably
* as the ObjC compiler currently uses quadword (q/Q) encoding for
* integer types on some 64bit systems, so the i/l/q/I/L/Q encodings
* can vary.
*/
char c = type_map[(t2 & _GSC_MASK)];
if ((c == _C_INT || c == _C_LNG
#ifdef _C_LNG_LNG
|| c == _C_LNG_LNG
#endif
) && (t1 == _C_INT || t1 == _C_LNG
#ifdef _C_LNG_LNG
|| t1 == _C_LNG_LNG
#endif
)) return;
if ((c == _C_UINT || c == _C_ULNG
#ifdef _C_LNG_LNG
|| c == _C_ULNG_LNG
#endif
) && (t1 == _C_UINT || t1 == _C_ULNG
#ifdef _C_LNG_LNG
|| t1 == _C_ULNG_LNG
#endif
)) return;
[NSException raise: NSInternalInconsistencyException
format: @"expected %s and got %s",
typeToName1(t1), typeToName2(t2)];