diff options
author | Felix Fietkau <nbd@openwrt.org> | 2005-04-06 21:39:12 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2005-04-06 21:39:12 +0000 |
commit | 8afa8fb2798acc15ca0bfca1b96f62d593ce3539 (patch) | |
tree | 3f0ba2871de8a4d23705a7fe0073d69321f69434 /openwrt/toolchain/utils/src | |
parent | 435773e10bbf1f2c03bb5187389ada4842705d5a (diff) | |
download | mtk-20170518-8afa8fb2798acc15ca0bfca1b96f62d593ce3539.zip mtk-20170518-8afa8fb2798acc15ca0bfca1b96f62d593ce3539.tar.gz mtk-20170518-8afa8fb2798acc15ca0bfca1b96f62d593ce3539.tar.bz2 |
add some fixes for compiling on mac os x
SVN-Revision: 574
Diffstat (limited to 'openwrt/toolchain/utils/src')
-rw-r--r-- | openwrt/toolchain/utils/src/sstrip.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 <unistd.h> #include <fcntl.h> #include <elf.h> + #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 <machine/endian.h> +#include <machine/byte_order.h> +#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 <endian.h> #include <byteswap.h> -#endif /* defined(__FreeBSD__) */ +#endif #ifndef TRUE |