Fixed MinGW build.

This commit is contained in:
bkaradzic
2013-04-07 13:44:44 -07:00
parent 78a7ae6139
commit 3474933375
2 changed files with 19 additions and 0 deletions

View File

@@ -135,4 +135,13 @@
# pragma warning(error:4505) // ENABLE warning C4505: '' : unreferenced local function has been removed
#endif // BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS && BX_COMPILER_MSVC
#if BX_PLATFORM_WINDOWS
// http://msdn.microsoft.com/en-us/library/6sehtctf.aspx
# if !defined(WINVER) && !defined(_WIN32_WINNT)
// Windows 2000 and above
# define WINVER 0x0500
# define _WIN32_WINNT 0x0500
# endif // !defined(WINVER) && !defined(_WIN32_WINNT)
#endif // BX_PLATFORM_WINDOWS
#endif // __BX_PLATFORM_H__

View File

@@ -14,6 +14,7 @@
namespace bx
{
/// Case insensitive string compare.
inline int32_t stricmp(const char* _a, const char* _b)
{
#if BX_COMPILER_MSVC
@@ -23,6 +24,15 @@ namespace bx
#endif // BX_COMPILER_
}
///
inline size_t strnlen(const char* _str, size_t _max)
{
const char* end = _str + _max;
const char* ptr;
for (ptr = _str; ptr < end && *ptr != '\0'; ++ptr);
return ptr - _str;
}
/// Find substring in string. Limit search to _size.
inline const char* strnstr(const char* _str, const char* _find, size_t _size)
{