From 0f3bb822169683b0b5522afed41ef1a5a14df53b Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Thu, 17 Oct 2019 15:59:37 +0200 Subject: [PATCH] Improve BSD support, tested on NetBSD. --- include/bx/platform.h | 9 ++++++++- src/mutex.cpp | 1 + src/thread.cpp | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/bx/platform.h b/include/bx/platform.h index 8195cfe..1565482 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -35,6 +35,7 @@ #define BX_CRT_MINGW 0 #define BX_CRT_MSVC 0 #define BX_CRT_NEWLIB 0 +#define BX_CRT_BSD 0 #ifndef BX_CRT_MUSL # define BX_CRT_MUSL 0 @@ -242,6 +243,9 @@ # elif defined(__apple_build_version__) || defined(__ORBIS__) || defined(__EMSCRIPTEN__) || defined(__llvm__) || defined(__HAIKU__) # undef BX_CRT_LIBCXX # define BX_CRT_LIBCXX 1 +# elif BX_PLATFORM_BSD +# undef BX_CRT_BSD +# define BX_CRT_BSD 1 # endif // # if !BX_CRT_BIONIC \ @@ -250,7 +254,8 @@ && !BX_CRT_MINGW \ && !BX_CRT_MSVC \ && !BX_CRT_MUSL \ - && !BX_CRT_NEWLIB + && !BX_CRT_NEWLIB \ + && !BX_CRT_BSD # undef BX_CRT_NONE # define BX_CRT_NONE 1 # endif // BX_CRT_* @@ -425,6 +430,8 @@ # define BX_CRT_NAME "Newlib" #elif BX_CRT_MUSL # define BX_CRT_NAME "musl libc" +#elif BX_CRT_BSD +# define BX_CRT_NAME "BSD" #elif BX_CRT_NONE # define BX_CRT_NAME "None" #else diff --git a/src/mutex.cpp b/src/mutex.cpp index 48f09d0..70aa4c2 100644 --- a/src/mutex.cpp +++ b/src/mutex.cpp @@ -17,6 +17,7 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ + || BX_PLATFORM_BSD \ || BX_PLATFORM_RPI # include #elif BX_PLATFORM_WINDOWS \ diff --git a/src/thread.cpp b/src/thread.cpp index 7969d78..a7a2550 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -20,6 +20,7 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ + || BX_PLATFORM_BSD \ || BX_PLATFORM_RPI # include # if defined(__FreeBSD__)