diff options
| author | 2015-07-22 15:46:15 -0400 | |
|---|---|---|
| committer | 2015-07-22 15:46:15 -0400 | |
| commit | b83cc37ae2d4d1b60ba3e77cb9740b52bbaf0cbf (patch) | |
| tree | 26d0baf978cbdf2d826c9486bb9c8992f117746c /3rdparty | |
| parent | f395bf7dd363ba8fbae3e5ff1bf10e5ee48ca882 (diff) | |
| parent | 7769689bd7625289fe2416a21d8971060f17fe2b (diff) | |
Merge pull request #257 from 0-wiz-0/master
Re-add NetBSD support.
Diffstat (limited to '3rdparty')
| -rw-r--r-- | 3rdparty/bgfx/src/renderer_null.cpp | 8 | ||||
| -rw-r--r-- | 3rdparty/bx/include/bx/os.h | 5 | ||||
| -rw-r--r-- | 3rdparty/bx/include/bx/platform.h | 7 | ||||
| -rw-r--r-- | 3rdparty/portmidi/porttime/ptlinux.c | 12 |
4 files changed, 20 insertions, 12 deletions
diff --git a/3rdparty/bgfx/src/renderer_null.cpp b/3rdparty/bgfx/src/renderer_null.cpp index ce5f812448b..5a86523fc57 100644 --- a/3rdparty/bgfx/src/renderer_null.cpp +++ b/3rdparty/bgfx/src/renderer_null.cpp @@ -33,7 +33,7 @@ namespace bgfx { namespace noop { } - void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint8_t /*_flags*/) BX_OVERRIDE + void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint16_t /*_flags*/) BX_OVERRIDE { } @@ -49,7 +49,7 @@ namespace bgfx { namespace noop { } - void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint8_t /*_flags*/) BX_OVERRIDE + void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint16_t /*_flags*/) BX_OVERRIDE { } @@ -57,7 +57,7 @@ namespace bgfx { namespace noop { } - void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE + void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE { } @@ -69,7 +69,7 @@ namespace bgfx { namespace noop { } - void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE + void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE { } diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h index 4fcd2c08079..5daae404b8c 100644 --- a/3rdparty/bx/include/bx/os.h +++ b/3rdparty/bx/include/bx/os.h @@ -17,11 +17,12 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_OSX \ || BX_PLATFORM_RPI # include <sched.h> // sched_yield -# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_OSX +# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD || BX_PLATFORM_OSX # include <pthread.h> // mach_port_t # endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL @@ -93,7 +94,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 08b31bf787f..962a8a6fc6d 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -18,6 +18,7 @@ #define BX_PLATFORM_IOS 0 #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 +#define BX_PLATFORM_NETBSD 0 #define BX_PLATFORM_OSX 0 #define BX_PLATFORM_PS4 0 #define BX_PLATFORM_QNX 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 // @@ -198,6 +202,7 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_OSX \ || BX_PLATFORM_QNX \ || BX_PLATFORM_RPI \ @@ -250,6 +255,8 @@ #elif BX_PLATFORM_NACL # define BX_PLATFORM_NAME "NaCl " \ BX_STRINGIZE(BX_PLATFORM_NACL) +#elif BX_PLATFORM_NETBSD +# define BX_PLATFORM_NAME "NetBSD" #elif BX_PLATFORM_OSX # define BX_PLATFORM_NAME "OSX" #elif BX_PLATFORM_PS4 diff --git a/3rdparty/portmidi/porttime/ptlinux.c b/3rdparty/portmidi/porttime/ptlinux.c index 768dd4847f7..c58107c36ad 100644 --- a/3rdparty/portmidi/porttime/ptlinux.c +++ b/3rdparty/portmidi/porttime/ptlinux.c @@ -38,7 +38,7 @@ CHANGE LOG #define FALSE 0 static int time_started_flag = FALSE; -static struct timeb time_offset = {0, 0, 0, 0}; +static struct timeval time_offset = {0, 0}; static pthread_t pt_thread_pid; static int pt_thread_created = FALSE; @@ -79,7 +79,7 @@ static void *Pt_CallbackProc(void *p) PtError Pt_Start(int resolution, PtCallback *callback, void *userData) { if (time_started_flag) return ptNoError; - ftime(&time_offset); /* need this set before process runs */ + gettimeofday(&time_offset, NULL); /* need this set before process runs */ if (callback) { int res; pt_callback_parameters *parms = (pt_callback_parameters *) @@ -121,10 +121,10 @@ int Pt_Started() PtTimestamp Pt_Time() { long seconds, milliseconds; - struct timeb now; - ftime(&now); - seconds = now.time - time_offset.time; - milliseconds = now.millitm - time_offset.millitm; + struct timeval now; + gettimeofday(&now, NULL); + seconds = now.tv_sec - time_offset.tv_sec; + milliseconds = now.tv_usec - time_offset.tv_usec; return seconds * 1000 + milliseconds; } |
