diff --git a/src/crt.cpp b/src/crt.cpp index da7919e..e22a9b6 100644 --- a/src/crt.cpp +++ b/src/crt.cpp @@ -550,28 +550,3 @@ namespace bx } } // namespace bx - -#if BX_CRT_NONE -extern "C" void* memcpy(void* _dst, const void* _src, size_t _numBytes) -{ - bx::memCopy(_dst, _src, _numBytes); - return _dst; -} - -extern "C" void* memmove(void* _dst, const void* _src, size_t _numBytes) -{ - bx::memMove(_dst, _src, _numBytes); - return _dst; -} - -extern "C" void* memset(void* _dst, int _ch, size_t _numBytes) -{ - bx::memSet(_dst, uint8_t(_ch), _numBytes); - return _dst; -} - -extern "C" int32_t memcmp(const void* _lhs, const void* _rhs, size_t _numBytes) -{ - return bx::memCmp(_lhs, _rhs, _numBytes); -} -#endif // BX_CRT_NONE diff --git a/src/crtnone.cpp b/src/crtnone.cpp index d2d9c54..f90d94a 100644 --- a/src/crtnone.cpp +++ b/src/crtnone.cpp @@ -9,6 +9,29 @@ #if BX_CRT_NONE +extern "C" void* memcpy(void* _dst, const void* _src, size_t _numBytes) +{ + bx::memCopy(_dst, _src, _numBytes); + return _dst; +} + +extern "C" void* memmove(void* _dst, const void* _src, size_t _numBytes) +{ + bx::memMove(_dst, _src, _numBytes); + return _dst; +} + +extern "C" void* memset(void* _dst, int _ch, size_t _numBytes) +{ + bx::memSet(_dst, uint8_t(_ch), _numBytes); + return _dst; +} + +extern "C" int32_t memcmp(const void* _lhs, const void* _rhs, size_t _numBytes) +{ + return bx::memCmp(_lhs, _rhs, _numBytes); +} + extern "C" size_t strlen(const char* _str) { return bx::strnlen(_str); @@ -363,7 +386,7 @@ extern "C" FILE* popen(const char* _command, const char* _type) { BX_UNUSED(_command, _type); return NULL; -}void* __dso_handle = (void*) &__dso_handle; +} extern "C" int pclose(FILE* _stream) {