mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Fixup for 10.5 compat
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27960 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8be39f3677
commit
0b528e776c
2 changed files with 38 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2009-02-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSPortCoder.m:
|
||||||
|
make float and double interchangable to cope with MacOS-X 10.5
|
||||||
|
API which can use either for CGFloat.
|
||||||
|
|
||||||
2009-02-23 Richard Frith-Macdonald <rfm@gnu.org>
|
2009-02-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Headers/Foundation/NSGeometry.h:
|
* Headers/Foundation/NSGeometry.h:
|
||||||
|
|
|
@ -260,6 +260,12 @@ typeCheck(char t1, char t2)
|
||||||
#endif
|
#endif
|
||||||
)) return;
|
)) return;
|
||||||
|
|
||||||
|
/* HACK also allow float and double to be used interchangably as MacOS-X
|
||||||
|
* intorduced CGFloat, which may be aither a float or a double.
|
||||||
|
*/
|
||||||
|
if ((c == _C_FLT || c == _C_DBL) && (t1 == _C_FLT || t1 == _C_DBL))
|
||||||
|
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)];
|
||||||
|
@ -923,12 +929,36 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
||||||
#endif
|
#endif
|
||||||
case _GSC_FLT:
|
case _GSC_FLT:
|
||||||
typeCheck(*type, _GSC_FLT);
|
typeCheck(*type, _GSC_FLT);
|
||||||
(*_dDesImp)(_src, dDesSel, address, type, &_cursor, nil);
|
if (*type == _C_FLT)
|
||||||
|
{
|
||||||
|
(*_dDesImp)(_src, dDesSel, address, type, &_cursor, nil);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float val;
|
||||||
|
|
||||||
|
/* We found a float when expecting a double ... handle it.
|
||||||
|
*/
|
||||||
|
(*_dDesImp)(_src, dDesSel, &val, @encode(float), &_cursor, nil);
|
||||||
|
*(double*)address = (double)val;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case _GSC_DBL:
|
case _GSC_DBL:
|
||||||
typeCheck(*type, _GSC_DBL);
|
typeCheck(*type, _GSC_DBL);
|
||||||
(*_dDesImp)(_src, dDesSel, address, type, &_cursor, nil);
|
if (*type == _C_DBL)
|
||||||
|
{
|
||||||
|
(*_dDesImp)(_src, dDesSel, address, type, &_cursor, nil);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double val;
|
||||||
|
|
||||||
|
/* We found a double when expecting a float ... handle it.
|
||||||
|
*/
|
||||||
|
(*_dDesImp)(_src, dDesSel, &val, @encode(double), &_cursor, nil);
|
||||||
|
*(float*)address = (float)val;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue