changeset 1122:700248c463e1

. Add MacOS X support. Submitted by: Landon Fuller
author Greg Lewis <glewis@eyesbeyond.com>
date Sun, 29 Nov 2009 18:56:28 -0800
parents da4d4eec0476
children a0039651311a
files src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp	Sun Nov 29 18:55:13 2009 -0800
+++ b/src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp	Sun Nov 29 18:56:28 2009 -0800
@@ -25,7 +25,14 @@
 // Efficient swapping of data bytes from Java byte
 // ordering to native byte ordering and vice versa.
 
-#include <sys/endian.h>
+#ifdef __APPLE__
+#include <libkern/OSByteOrder.h>
+#define bswap16(x) OSSwapInt16(x)
+#define bswap32(x) OSSwapInt32(x)
+#define bswap64(x) OSSwapInt64(x)
+#else
+#  include <sys/endian.h>
+#endif
 
 inline u2 Bytes::swap_u2(u2 x) {
   return bswap16(x);