Browse Source

Merge pull request #87 from mmicko/master

Use BX_PLATFORM_BSD for all BSD based platforms
Branimir Karadžić 10 years ago
parent
commit
435257d24c
5 changed files with 13 additions and 13 deletions
  1. 1 1
      include/bx/config.h
  2. 3 3
      include/bx/os.h
  3. 7 7
      include/bx/platform.h
  4. 1 1
      include/bx/readerwriter.h
  5. 1 1
      include/bx/thread.h

+ 1 - 1
include/bx/config.h

@@ -23,7 +23,7 @@
 #ifndef BX_CONFIG_CRT_FILE_READER_WRITER
 #	define BX_CONFIG_CRT_FILE_READER_WRITER (0 \
 				|| BX_PLATFORM_ANDROID \
-				|| BX_PLATFORM_FREEBSD \
+				|| BX_PLATFORM_BSD \
 				|| BX_PLATFORM_EMSCRIPTEN \
 				|| BX_PLATFORM_IOS \
 				|| BX_PLATFORM_LINUX \

+ 3 - 3
include/bx/os.h

@@ -14,7 +14,7 @@
 #	include <psapi.h>
 #elif  BX_PLATFORM_ANDROID \
 	|| BX_PLATFORM_EMSCRIPTEN \
-	|| BX_PLATFORM_FREEBSD \
+	|| BX_PLATFORM_BSD \
 	|| BX_PLATFORM_IOS \
 	|| BX_PLATFORM_LINUX \
 	|| BX_PLATFORM_NACL \
@@ -23,7 +23,7 @@
 	|| BX_PLATFORM_RPI
 
 #	include <sched.h> // sched_yield
-#	if BX_PLATFORM_FREEBSD \
+#	if BX_PLATFORM_BSD \
 	|| BX_PLATFORM_IOS \
 	|| BX_PLATFORM_NACL \
 	|| BX_PLATFORM_OSX \
@@ -103,7 +103,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_BSD || BX_PLATFORM_NACL
 		// Casting __nc_basic_thread_data*... need better way to do this.
 		return *(uint32_t*)::pthread_self();
 #else

+ 7 - 7
include/bx/platform.h

@@ -14,7 +14,7 @@
 
 #define BX_PLATFORM_ANDROID    0
 #define BX_PLATFORM_EMSCRIPTEN 0
-#define BX_PLATFORM_FREEBSD    0
+#define BX_PLATFORM_BSD        0
 #define BX_PLATFORM_IOS        0
 #define BX_PLATFORM_LINUX      0
 #define BX_PLATFORM_NACL       0
@@ -188,9 +188,9 @@
 #elif defined(__QNX__)
 #	undef  BX_PLATFORM_QNX
 #	define BX_PLATFORM_QNX 1
-#elif defined(__FreeBSD__)
-#	undef  BX_PLATFORM_FREEBSD
-#	define BX_PLATFORM_FREEBSD 1
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+#	undef  BX_PLATFORM_BSD
+#	define BX_PLATFORM_BSD 1
 #else
 #	error "BX_PLATFORM_* is not defined!"
 #endif //
@@ -198,7 +198,7 @@
 #define BX_PLATFORM_POSIX (0 \
 						|| BX_PLATFORM_ANDROID \
 						|| BX_PLATFORM_EMSCRIPTEN \
-						|| BX_PLATFORM_FREEBSD \
+						|| BX_PLATFORM_BSD \
 						|| BX_PLATFORM_IOS \
 						|| BX_PLATFORM_LINUX \
 						|| BX_PLATFORM_NACL \
@@ -246,8 +246,8 @@
 				BX_STRINGIZE(__EMSCRIPTEN_major__) "." \
 				BX_STRINGIZE(__EMSCRIPTEN_minor__) "." \
 				BX_STRINGIZE(__EMSCRIPTEN_tiny__)
-#elif BX_PLATFORM_FREEBSD
-#	define BX_PLATFORM_NAME "FreeBSD"
+#elif BX_PLATFORM_BSD
+#	define BX_PLATFORM_NAME "BSD"
 #elif BX_PLATFORM_IOS
 #	define BX_PLATFORM_NAME "iOS"
 #elif BX_PLATFORM_LINUX

+ 1 - 1
include/bx/readerwriter.h

@@ -17,7 +17,7 @@
 #if BX_COMPILER_MSVC_COMPATIBLE
 #	define fseeko64 _fseeki64
 #	define ftello64 _ftelli64
-#elif BX_PLATFORM_ANDROID || BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_QNX
+#elif BX_PLATFORM_ANDROID || BX_PLATFORM_BSD || BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_QNX
 #	define fseeko64 fseeko
 #	define ftello64 ftello
 #endif // BX_

+ 1 - 1
include/bx/thread.h

@@ -149,7 +149,7 @@ namespace bx
 		{
 #if BX_PLATFORM_OSX || BX_PLATFORM_IOS
 			pthread_setname_np(_name);
-#elif (BX_PLATFORM_LINUX && defined(__GLIBC__)) || BX_PLATFORM_FREEBSD
+#elif (BX_PLATFORM_LINUX && defined(__GLIBC__)) || BX_PLATFORM_BSD
 			pthread_setname_np(m_handle, _name);
 #elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC
 #	pragma pack(push, 8)