$OpenBSD: patch-common_platform_linux_h,v 1.11 2011/06/02 12:46:37 ajacoutot Exp $
--- common/platform.linux.h.orig	Wed Apr 20 19:51:45 2011
+++ common/platform.linux.h	Thu Jun  2 10:41:55 2011
@@ -63,8 +63,16 @@
 #include <dlfcn.h>
 #include <stddef.h>
 #include <libgen.h>
+#if defined(__OpenBSD__)
+#include <sys/endian.h>
+#include <sys/param.h>
+#ifndef MAX_PATH
+  #define MAX_PATH PATH_MAX
+#endif
+#else
 #include <byteswap.h>
 #include <endian.h>
+#endif
 #include <errno.h>
 
 #include <string>
@@ -662,7 +670,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
@@ -670,14 +682,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 OutputDebugStringA(dstr) fprintf(stderr,"%s",dstr)
-#define GetCurrentThreadId() (int)pthread_self()
+#define GetCurrentThreadId() (intptr_t)pthread_self()
 #define GetTickCount() 0L
 
 #define TICKS_PER_SEC (sysconf(_SC_CLK_TCK))
