diff options
author | Thomas Klausner <wiz@NetBSD.org> | 2015-11-13 14:28:32 +0100 |
---|---|---|
committer | Thomas Klausner <wiz@NetBSD.org> | 2015-11-13 14:30:25 +0100 |
commit | 79fb7f477852fad15cd0343c7600cda45d9a1a54 (patch) | |
tree | b11c36967e3682695f9712672bce7f9f819b6927 /3rdparty/bx | |
parent | d0c77ed333fa5e96333cd4ca49ce2e82048f8c88 (diff) |
bx: add NetBSD support.
I've filed a more complete patch for this upstream:
https://github.com/bkaradzic/bx/pull/61
but this has been ignored since June. This patch is the minimal
set to fix the build on NetBSD.
Diffstat (limited to '3rdparty/bx')
-rw-r--r-- | 3rdparty/bx/include/bx/os.h | 4 | ||||
-rw-r--r-- | 3rdparty/bx/include/bx/platform.h | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h index 0adf87b55ce..9dc1a607404 100644 --- a/3rdparty/bx/include/bx/os.h +++ b/3rdparty/bx/include/bx/os.h @@ -15,6 +15,7 @@ #elif BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_FREEBSD \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ @@ -24,6 +25,7 @@ # include <sched.h> // sched_yield # if BX_PLATFORM_FREEBSD \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_NACL \ || BX_PLATFORM_OSX \ @@ -103,7 +105,7 @@ namespace bx return (pid_t)::syscall(SYS_gettid); #elif BX_PLATFORM_IOS || BX_PLATFORM_OSX return (mach_port_t)::pthread_mach_thread_np(pthread_self() ); -#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL +#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD // Casting __nc_basic_thread_data*... need better way to do this. return *(uint32_t*)::pthread_self(); #else diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h index 8de637b96ef..c25febcd13f 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -15,6 +15,7 @@ #define BX_PLATFORM_ANDROID 0 #define BX_PLATFORM_EMSCRIPTEN 0 #define BX_PLATFORM_FREEBSD 0 +#define BX_PLATFORM_NETBSD 0 #define BX_PLATFORM_IOS 0 #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 @@ -187,6 +188,9 @@ #elif defined(__FreeBSD__) # undef BX_PLATFORM_FREEBSD # define BX_PLATFORM_FREEBSD 1 +#elif defined(__NetBSD__) +# undef BX_PLATFORM_NETBSD +# define BX_PLATFORM_NETBSD 1 #else # error "BX_PLATFORM_* is not defined!" #endif // @@ -195,6 +199,7 @@ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_FREEBSD \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ @@ -244,6 +249,8 @@ BX_STRINGIZE(__EMSCRIPTEN_tiny__) #elif BX_PLATFORM_FREEBSD # define BX_PLATFORM_NAME "FreeBSD" +#elif BX_PLATFORM_NETBSD +# define BX_PLATFORM_NAME "NetBSD" #elif BX_PLATFORM_IOS # define BX_PLATFORM_NAME "iOS" #elif BX_PLATFORM_LINUX |