Disable BX_CRT_NONE detection.

This commit is contained in:
Branimir Karadžić
2017-02-09 19:24:40 -08:00
parent c87dbe3d02
commit 878883f568
2 changed files with 13 additions and 12 deletions

View File

@@ -29,12 +29,13 @@
#define BX_CPU_X86 0
// C Runtime
#define BX_CRT_MSVC 0
#define BX_CRT_GLIBC 0
#define BX_CRT_LIBCXX 0
#define BX_CRT_NEWLIB 0
#define BX_CRT_MINGW 0
#define BX_CRT_MSVC 0
#define BX_CRT_MUSL 0
#define BX_CRT_NEWLIB 0
#define BX_CRT_NONE 0
// Platform
#define BX_PLATFORM_ANDROID 0
@@ -254,15 +255,6 @@
|| BX_PLATFORM_RPI \
)
#define BX_CRT_NONE !(0 \
|| BX_CRT_MSVC \
|| BX_CRT_GLIBC \
|| BX_CRT_LIBCXX \
|| BX_CRT_NEWLIB \
|| BX_CRT_MINGW \
|| BX_CRT_MUSL \
)
#ifndef BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS
# define BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS 0
#endif // BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS

View File

@@ -121,7 +121,7 @@ namespace bx
#endif // BX_CRT_NONE
}
int32_t memCmp(const char* _lhs, const char* _rhs, size_t _numBytes)
int32_t memCmpRef(const char* _lhs, const char* _rhs, size_t _numBytes)
{
for (
; 0 < _numBytes && *_lhs == *_rhs
@@ -133,6 +133,15 @@ namespace bx
return 0 == _numBytes ? 0 : *_lhs - *_rhs;
}
int32_t memCmp(const char* _lhs, const char* _rhs, size_t _numBytes)
{
#if BX_CRT_NONE
return memCmpRef(_lhs, _rhs, _numBytes);
#else
return ::memcmp(_lhs, _rhs, _numBytes);
#endif // BX_CRT_NONE
}
namespace
{
struct Param