aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/utils/src
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-04-06 21:39:12 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-04-06 21:39:12 +0000
commite715f06cce4db280afeba48b63e986c274d2d404 (patch)
tree950c816ee6ef392dc87f6d67b093bdcd74c579a5 /toolchain/utils/src
parentcea2662209277c3b4b325c365dd65c12002b0981 (diff)
downloadupstream-e715f06cce4db280afeba48b63e986c274d2d404.tar.gz
upstream-e715f06cce4db280afeba48b63e986c274d2d404.tar.bz2
upstream-e715f06cce4db280afeba48b63e986c274d2d404.zip
add some fixes for compiling on mac os x
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@574 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain/utils/src')
-rw-r--r--toolchain/utils/src/sstrip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/toolchain/utils/src/sstrip.c b/toolchain/utils/src/sstrip.c
index e820a44b88..60c12c972c 100644
--- a/toolchain/utils/src/sstrip.c
+++ b/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