diff --git a/include/bx/platform.h b/include/bx/platform.h index 44af44c..ff461f7 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -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 diff --git a/src/crt.cpp b/src/crt.cpp index a13400a..9fbc208 100644 --- a/src/crt.cpp +++ b/src/crt.cpp @@ -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