mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Replaced pragma warning with runtime error. Added toBool.
This commit is contained in:
@@ -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__
|
||||
|
||||
@@ -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 //
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user