From 8afa8fb2798acc15ca0bfca1b96f62d593ce3539 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 6 Apr 2005 21:39:12 +0000 Subject: add some fixes for compiling on mac os x SVN-Revision: 574 --- openwrt/toolchain/utils/src/sstrip.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'openwrt/toolchain/utils/src') diff --git a/openwrt/toolchain/utils/src/sstrip.c b/openwrt/toolchain/utils/src/sstrip.c index e820a44..60c12c9 100644 --- a/openwrt/toolchain/utils/src/sstrip.c +++ b/openwrt/toolchain/utils/src/sstrip.c @@ -59,6 +59,7 @@ #include #include #include + #ifdef __FreeBSD__ /** * This seems to work on FreeBSD 5.3, should @@ -71,10 +72,18 @@ #define bswap_64 __bswap64 #define bswap_32 __bswap32 #define bswap_16 __bswap16 +#elif defined(__APPLE__) +#include +#include +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define bswap_16(x) NXSwapShort(x) +#define bswap_32(x) NXSwapInt(x) +#define bswap_64(x) NXSwapLongLong(x) #else #include #include -#endif /* defined(__FreeBSD__) */ +#endif #ifndef TRUE -- cgit v1.1