From 0ed41d71e7c1d7ace785ab6b82920dee4d28da53 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Wed, 7 Aug 2013 21:48:23 -0700 Subject: [PATCH] Replaced pragma warning with runtime error. Added toBool. --- include/bx/bx.h | 7 ++++++- include/bx/os.h | 6 +++++- include/bx/string.h | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/bx/bx.h b/include/bx/bx.h index c2c9688..82804cc 100644 --- a/include/bx/bx.h +++ b/include/bx/bx.h @@ -6,7 +6,9 @@ #ifndef __BX_H__ #define __BX_H__ -#include +#include // uint32_t +#include // size_t + #include "platform.h" #include "macros.h" @@ -18,4 +20,7 @@ namespace bx } // namespace bx +// Annoying C++0x stuff.. +namespace std { namespace tr1 {}; using namespace tr1; } + #endif // __BX_H__ diff --git a/include/bx/os.h b/include/bx/os.h index 38187fa..d4f103b 100644 --- a/include/bx/os.h +++ b/include/bx/os.h @@ -20,6 +20,9 @@ # include // syscall # include # endif // BX_PLATFORM_LINUX +# if BX_PLATFORM_ANDROID +# include "debug.h" // getTid is not implemented... +# endif // BX_PLATFORM_ANDROID #endif // BX_PLATFORM_ namespace bx @@ -58,7 +61,8 @@ namespace bx // Casting __nc_basic_thread_data*... need better way to do this. return *(uint32_t*)::pthread_self(); #else -# pragma message "not implemented." +//# pragma message "not implemented." + debugOutput("getTid is not implemented"); debugBreak(); return 0; #endif // } diff --git a/include/bx/string.h b/include/bx/string.h index 6baa2cd..335c87a 100644 --- a/include/bx/string.h +++ b/include/bx/string.h @@ -8,6 +8,7 @@ #include "bx.h" #include +#include // tolower #include // va_list #include // vsnprintf, vsnwprintf #include @@ -16,6 +17,12 @@ namespace bx { + inline bool toBool(const char* _str) + { + char ch = tolower(_str[0]); + return ch == 't' || ch == '1'; + } + /// Case insensitive string compare. inline int32_t stricmp(const char* _a, const char* _b) {