Replaced pragma warning with runtime error. Added toBool.

This commit is contained in:
bkaradzic
2013-08-07 21:48:23 -07:00
parent bbdd6e8856
commit 0ed41d71e7
3 changed files with 18 additions and 2 deletions

View File

@@ -6,7 +6,9 @@
#ifndef __BX_H__
#define __BX_H__
#include <stdint.h>
#include <stdint.h> // uint32_t
#include <stdlib.h> // 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__

View File

@@ -20,6 +20,9 @@
# include <unistd.h> // syscall
# include <sys/syscall.h>
# 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 //
}

View File

@@ -8,6 +8,7 @@
#include "bx.h"
#include <alloca.h>
#include <ctype.h> // tolower
#include <stdarg.h> // va_list
#include <stdio.h> // vsnprintf, vsnwprintf
#include <string.h>
@@ -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)
{