Previous 199869 Revisions Next

r41718 Friday 13th November, 2015 at 13:30:25 UTC by Thomas Klausner
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.
[3rdparty/bx/include/bx]os.h platform.h

trunk/3rdparty/bx/include/bx/os.h
r250229r250230
1515#elif  BX_PLATFORM_ANDROID \
1616   || BX_PLATFORM_EMSCRIPTEN \
1717   || BX_PLATFORM_FREEBSD \
18   || BX_PLATFORM_NETBSD \
1819   || BX_PLATFORM_IOS \
1920   || BX_PLATFORM_LINUX \
2021   || BX_PLATFORM_NACL \
r250229r250230
2425
2526#   include <sched.h> // sched_yield
2627#   if BX_PLATFORM_FREEBSD \
28   || BX_PLATFORM_NETBSD \
2729   || BX_PLATFORM_IOS \
2830   || BX_PLATFORM_NACL \
2931   || BX_PLATFORM_OSX \
r250229r250230
103105      return (pid_t)::syscall(SYS_gettid);
104106#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
105107      return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
106#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL
108#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD
107109      // Casting __nc_basic_thread_data*... need better way to do this.
108110      return *(uint32_t*)::pthread_self();
109111#else
trunk/3rdparty/bx/include/bx/platform.h
r250229r250230
1515#define BX_PLATFORM_ANDROID    0
1616#define BX_PLATFORM_EMSCRIPTEN 0
1717#define BX_PLATFORM_FREEBSD    0
18#define BX_PLATFORM_NETBSD     0
1819#define BX_PLATFORM_IOS        0
1920#define BX_PLATFORM_LINUX      0
2021#define BX_PLATFORM_NACL       0
r250229r250230
187188#elif defined(__FreeBSD__)
188189#   undef  BX_PLATFORM_FREEBSD
189190#   define BX_PLATFORM_FREEBSD 1
191#elif defined(__NetBSD__)
192#   undef  BX_PLATFORM_NETBSD
193#   define BX_PLATFORM_NETBSD 1
190194#else
191195#   error "BX_PLATFORM_* is not defined!"
192196#endif //
r250229r250230
195199                  || BX_PLATFORM_ANDROID \
196200                  || BX_PLATFORM_EMSCRIPTEN \
197201                  || BX_PLATFORM_FREEBSD \
202                  || BX_PLATFORM_NETBSD \
198203                  || BX_PLATFORM_IOS \
199204                  || BX_PLATFORM_LINUX \
200205                  || BX_PLATFORM_NACL \
r250229r250230
244249            BX_STRINGIZE(__EMSCRIPTEN_tiny__)
245250#elif BX_PLATFORM_FREEBSD
246251#   define BX_PLATFORM_NAME "FreeBSD"
252#elif BX_PLATFORM_NETBSD
253#   define BX_PLATFORM_NAME "NetBSD"
247254#elif BX_PLATFORM_IOS
248255#   define BX_PLATFORM_NAME "iOS"
249256#elif BX_PLATFORM_LINUX


Previous 199869 Revisions Next


© 1997-2024 The MAME Team