From 2dabd70335c44544e85aa2c793d018537a96b3d0 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Wed, 27 Jun 2012 20:48:52 -0700 Subject: [PATCH] Added BX_PLATFORM_POSIX. --- include/bx/blockalloc.h | 2 +- include/bx/platform.h | 2 ++ include/bx/sem.h | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/bx/blockalloc.h b/include/bx/blockalloc.h index e7d0704..7597653 100644 --- a/include/bx/blockalloc.h +++ b/include/bx/blockalloc.h @@ -64,7 +64,7 @@ namespace bx void free(void* _obj) { uint16_t index = getIndex(_obj); - BX_CHECK(index >= 0 && index < m_num, "index %d, m_num %d", index, m_num); + BX_CHECK(index < m_num, "index %d, m_num %d", index, m_num); *( (uint16_t*)_obj) = m_freeIndex; m_freeIndex = index; diff --git a/include/bx/platform.h b/include/bx/platform.h index 18d36a2..7e8e290 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -71,6 +71,8 @@ # error "BX_PLATFORM_* is not defined!" #endif // +#define BX_PLATFORM_POSIX (BX_PLATFORM_NACL || BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX || BX_PLATFORM_OSX || BX_PLATFORM_IOS) + // http://sourceforge.net/apps/mediawiki/predef/index.php?title=Architectures #if defined(__arm__) # undef BX_CPU_ARM diff --git a/include/bx/sem.h b/include/bx/sem.h index 8ca50ab..118e4f7 100644 --- a/include/bx/sem.h +++ b/include/bx/sem.h @@ -8,9 +8,7 @@ #include "bx.h" -#define BX_SEM_CONFIG_POSIX (BX_PLATFORM_NACL || BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX) - -#if BX_SEM_CONFIG_POSIX +#if BX_PLATFORM_POSIX # include # include #elif BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 @@ -19,7 +17,7 @@ namespace bx { -#if BX_SEM_CONFIG_POSIX +#if BX_PLATFORM_POSIX class Semaphore { public: