mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
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:
parent
2dc1962a6b
commit
dcb3070d9c
3 changed files with 60 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2005-07-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSUnarchiver.m:
|
||||||
|
* Source/NSPortCoder.m: Relax checking of decoded types information
|
||||||
|
to allow int/long/longlong types to be decoded using 'i/l/q'
|
||||||
|
interchangably and 'I/L'Q' interchangably because the compiler may
|
||||||
|
use different encodings on different machines.
|
||||||
|
|
||||||
2005-07-15 Adam Fedor <fedor@gnu.org>
|
2005-07-15 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* ChangeLog, ChangeLog.1, ChangeLog.2, GNUmakefile, Makefile,
|
* ChangeLog, ChangeLog.1, ChangeLog.2, GNUmakefile, Makefile,
|
||||||
|
|
|
@ -234,6 +234,32 @@ typeCheck(char t1, char t2)
|
||||||
{
|
{
|
||||||
if (type_map[(t2 & _GSC_MASK)] != t1)
|
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
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"expected %s and got %s",
|
format: @"expected %s and got %s",
|
||||||
typeToName1(t1), typeToName2(t2)];
|
typeToName1(t1), typeToName2(t2)];
|
||||||
|
|
|
@ -194,6 +194,32 @@ typeCheck(char t1, char t2)
|
||||||
{
|
{
|
||||||
if (type_map[(t2 & _GSC_MASK)] != t1)
|
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
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"expected %s and got %s",
|
format: @"expected %s and got %s",
|
||||||
typeToName1(t1), typeToName2(t2)];
|
typeToName1(t1), typeToName2(t2)];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue