$OpenBSD: patch-hotspot_src_os_cpu_bsd_zero_vm_bytes_bsd_zero_inline_hpp,v 1.1 2011/01/11 15:47:49 kurt Exp $
--- hotspot/src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp.orig	Fri Oct 29 12:02:41 2010
+++ hotspot/src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp	Fri Oct 29 12:02:50 2010
@@ -25,16 +25,23 @@
 // Efficient swapping of data bytes from Java byte
 // ordering to native byte ordering and vice versa.
 
-#include <byteswap.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 bswap_16(x);
+  return bswap16(x);
 }
 
 inline u4 Bytes::swap_u4(u4 x) {
-  return bswap_32(x);
+  return bswap32(x);
 }
 
 inline u8 Bytes::swap_u8(u8 x) {
-  return bswap_64(x);
+  return bswap64(x);
 }
