$OpenBSD: patch-common_platform_linux_h,v 1.7 2010/06/30 02:46:48 ajacoutot Exp $
--- common/platform.linux.h.orig	Mon May 31 19:28:57 2010
+++ common/platform.linux.h	Tue Jun 15 16:26:32 2010
@@ -63,8 +63,15 @@
 #include <dlfcn.h>
 #include <stddef.h>
 #include <libgen.h>
+#if defined(__OpenBSD__)
+#include <sys/endian.h>
+#ifndef MAX_PATH
+  #define MAX_PATH 1024
+#endif
+#else
 #include <byteswap.h>
 #include <endian.h>
+#endif
 #include <errno.h>
 
 #include <string>
@@ -659,7 +666,11 @@ time_t GetProcessTime();
 
 #ifndef ntohll
 	#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef __OpenBSD__
 		#define ntohll(x) __bswap_64(x)
+#else
+		#define ntohll(x) __swap64(x)
+#endif // __OpenBSD__
 	#else
 		#define ntohll(x) (x)
 	#endif
@@ -667,14 +678,18 @@ time_t GetProcessTime();
 
 #ifndef htonll
 	#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef __OpenBSD__
 		#define htonll(x) __bswap_64(x)
+#else
+		#define htonll(x) __swap64(x)
+#endif // __OpenBSD__
 	#else
 		#define htonll(x) (x)
 	#endif
 #endif
 
 #define OutputDebugString(dstr) fprintf(stderr,"%s",dstr)
-#define GetCurrentThreadId() (int)pthread_self()
+#define GetCurrentThreadId() (long)pthread_self()
 #define GetTickCount() 0L
 
 #define TICKS_PER_SEC (sysconf(_SC_CLK_TCK))
