Fix NSByteOrder

This commit is contained in:
Matvii Jarosh 2024-11-26 17:51:28 +02:00
parent 64308292a8
commit ba0d5403f9
3 changed files with 31 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2024-11-26 Matvii Jarosh <matviijarosh@gmail.com>
* NSByteOrder.h: fix NSSwappedFloat and NSSwappedDouble
* MISSING:
2024-11-25 Matvii Jarosh <matviijarosh@gmail.com>
* NSInvocation.h: add enum _NSObjCValueType and

View file

@ -384,13 +384,37 @@ NSSwapShort(unsigned short in)
static inline NSSwappedDouble
NSSwapDouble(NSSwappedDouble num)
{
#if GS_SIZEOF_DOUBLE == 2
return GSSwapI16(num);
#else
#if GS_SIZEOF_DOUBLE == 4
return GSSwapI32(num);
#else
#if GS_SIZEOF_DOUBLE == 8
return GSSwapI64(num);
#else
return GSSwapI128(num);
#endif
#endif
#endif
}
static inline NSSwappedFloat
NSSwapFloat(NSSwappedFloat num)
{
#if GS_SIZEOF_FLOAT == 2
return GSSwapI16(num);
#else
#if GS_SIZEOF_FLOAT == 4
return GSSwapI32(num);
#else
#if GS_SIZEOF_FLOAT == 8
return GSSwapI64(num);
#else
return GSSwapI128(num);
#endif
#endif
#endif
}
#if GS_WORDS_BIGENDIAN

View file

@ -32,10 +32,6 @@ NSBundle:
/** Not implemented */ (GNUstep comment)
- executableArchitectures;
-------------------------------------------------------------
NSByteOrder:
NSSwappedFloat — incompatible declaration
NSSwappedDouble — incompatible declaration
-------------------------------------------------------------
NSCalendar:
NSWeekOfMonthCalendarUnit
NSWeekOfYearCalendarUnit
@ -880,4 +876,5 @@ Good headers:
<NSXMLDTD.h>
<NSXMLDTDNode.h>
<NSXMLElement.h>
<NSInvocation.h>
<NSInvocation.h>
<NSByteOrder.h>