From 340ac7412fed5942390a00991880470393afeb06 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Thu, 17 Oct 2013 19:22:27 -0700 Subject: [PATCH 1/5] Added unused function test. --- tests/macros.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/macros.cpp b/tests/macros.cpp index 738cbec..4e5a553 100644 --- a/tests/macros.cpp +++ b/tests/macros.cpp @@ -28,6 +28,11 @@ BX_STATIC_ASSERT(256 == BX_ALIGN_256(256) ); BX_STATIC_ASSERT(256 == BX_ALIGN_256(256) ); BX_STATIC_ASSERT(512 == BX_ALIGN_256(511) ); +BX_NO_INLINE void unusedFunction() +{ + CHECK(false); +} + TEST(macros) { uint32_t unused0; @@ -37,7 +42,7 @@ TEST(macros) BX_UNUSED(unused0, unused1); uint32_t unused2; - BX_UNUSED(unused0, unused1, unused2); + BX_UNUSED(unused0, unused1, unused2, unusedFunction() ); CHECK_EQUAL(1, BX_VA_ARGS_COUNT(1) ); CHECK_EQUAL(2, BX_VA_ARGS_COUNT(1, 2) ); From 2330faed36dd34f74ed3f155ad07cf1d75a2b818 Mon Sep 17 00:00:00 2001 From: Branimir Karadzic Date: Thu, 17 Oct 2013 19:48:30 -0700 Subject: [PATCH 2/5] iOS: Fixed pthread include. --- include/bx/os.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/bx/os.h b/include/bx/os.h index 2c94b62..3785c66 100644 --- a/include/bx/os.h +++ b/include/bx/os.h @@ -12,19 +12,22 @@ # include #elif BX_PLATFORM_NACL || BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX || BX_PLATFORM_OSX || BX_PLATFORM_IOS # include // sched_yield -# if BX_PLATFORM_OSX || BX_PLATFORM_NACL +# if BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL # include // mach_port_t -# endif // BX_PLATFORM_OSX || BX_PLATFORM_NACL +# endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL + # if BX_PLATFORM_NACL # include // nanosleep # else # include // nanosleep # include // dlopen, dlclose, dlsym # endif // BX_PLATFORM_NACL + # if BX_PLATFORM_LINUX # include // syscall # include # endif // BX_PLATFORM_LINUX + # if BX_PLATFORM_ANDROID # include "debug.h" // getTid is not implemented... # endif // BX_PLATFORM_ANDROID From 4104e3531a1ff4a4d6be21cdbc7677ee9e87b85a Mon Sep 17 00:00:00 2001 From: Branimir Karadzic Date: Thu, 17 Oct 2013 20:05:30 -0700 Subject: [PATCH 3/5] Clang on OSX doesn't like static_assert. --- include/bx/macros.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/bx/macros.h b/include/bx/macros.h index fc0f9d8..ad15fb6 100644 --- a/include/bx/macros.h +++ b/include/bx/macros.h @@ -50,7 +50,6 @@ # define BX_NO_VTABLE # define BX_OVERRIDE # define BX_PRINTF_ARGS(_format, _args) __attribute__ ( (format(__printf__, _format, _args) ) ) -# define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__) # if BX_COMPILER_CLANG || BX_PLATFORM_IOS # define BX_THREAD /* not supported right now */ # else @@ -67,12 +66,14 @@ # define BX_NO_VTABLE __declspec(novtable) # define BX_OVERRIDE override # define BX_PRINTF_ARGS(_format, _args) -# define BX_STATIC_ASSERT(_condition, ...) typedef char BX_CONCATENATE(BX_STATIC_ASSERT_, __LINE__)[1][(_condition)] # define BX_THREAD __declspec(thread) #else # error "Unknown BX_COMPILER_?" #endif +// #define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__) +#define BX_STATIC_ASSERT(_condition, ...) typedef char BX_CONCATENATE(BX_STATIC_ASSERT_, __LINE__)[1][(_condition)] + #define BX_CACHE_LINE_ALIGN_MARKER() BX_ALIGN_STRUCT(BX_CACHE_LINE_SIZE, struct) {} #define BX_CACHE_LINE_ALIGN(_def) BX_CACHE_LINE_ALIGN_MARKER(); _def; BX_CACHE_LINE_ALIGN_MARKER() From 974d2d707808a1458f7595047520bbd19d5ec700 Mon Sep 17 00:00:00 2001 From: Branimir Karadzic Date: Thu, 17 Oct 2013 20:12:35 -0700 Subject: [PATCH 4/5] Fixed Clang warning. --- 3rdparty/UnitTest++/src/Posix/SignalTranslator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3rdparty/UnitTest++/src/Posix/SignalTranslator.h b/3rdparty/UnitTest++/src/Posix/SignalTranslator.h index bf98ad3..1daf139 100644 --- a/3rdparty/UnitTest++/src/Posix/SignalTranslator.h +++ b/3rdparty/UnitTest++/src/Posix/SignalTranslator.h @@ -22,8 +22,8 @@ private: struct sigaction m_old_SIGTRAP_action; struct sigaction m_old_SIGSEGV_action; struct sigaction m_old_SIGBUS_action; - struct sigaction m_old_SIGABRT_action; - struct sigaction m_old_SIGALRM_action; +// struct sigaction m_old_SIGABRT_action; +// struct sigaction m_old_SIGALRM_action; }; #if !defined (__GNUC__) From a36d56908d08e0460ca22357c0f75525c6f2484a Mon Sep 17 00:00:00 2001 From: Branimir Karadzic Date: Thu, 17 Oct 2013 20:13:11 -0700 Subject: [PATCH 5/5] OSX: Fixed unit test build. --- premake/bx.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/premake/bx.lua b/premake/bx.lua index 2facd24..ca50118 100644 --- a/premake/bx.lua +++ b/premake/bx.lua @@ -7,6 +7,16 @@ project "bx" uuid "4db0b09e-d6df-11e1-a0ec-65ccdd6a022f" kind "StaticLib" + configuration { "osx or ios" } + -- OSX ar doesn't like creating archive without object files + -- here is object file... + prebuildcommands { + "@echo \"void dummy() {}\" > /tmp/dummy.cpp", + } + files { + "/tmp/dummy.cpp", + } + files { "../include/**.h", }