diff options
author | 2023-01-04 23:29:18 -0500 | |
---|---|---|
committer | 2023-01-04 23:29:18 -0500 | |
commit | 94b1e168b2b97b48b81f7a8f64406b0a6f64184e (patch) | |
tree | f57362a0fa01bfe8f0ad75a447c4c9e10bc15756 /3rdparty/bx/src/os.cpp | |
parent | 5581eaa50a42256242f32569f59ce10d70ddd8c2 (diff) |
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a42256242f32569f59ce10d70ddd8c2 due to link failure on macOS.
Diffstat (limited to '3rdparty/bx/src/os.cpp')
-rw-r--r-- | 3rdparty/bx/src/os.cpp | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/3rdparty/bx/src/os.cpp b/3rdparty/bx/src/os.cpp index 99394579b72..12586aa8862 100644 --- a/3rdparty/bx/src/os.cpp +++ b/3rdparty/bx/src/os.cpp @@ -1,8 +1,9 @@ /* - * Copyright 2010-2022 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bx/blob/master/LICENSE + * Copyright 2010-2021 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ +#include "bx_p.h" #include <bx/string.h> #include <bx/os.h> #include <bx/uint32_t.h> @@ -14,9 +15,6 @@ #endif // BX_CRT_MSVC #if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif // WIN32_LEAN_AND_MEAN # include <windows.h> # include <psapi.h> #elif BX_PLATFORM_ANDROID \ @@ -185,19 +183,12 @@ namespace bx BX_UNUSED(_filePath); return NULL; #else - void* so = ::dlopen(_filePath.getCPtr(), RTLD_LOCAL|RTLD_LAZY); - BX_WARN(NULL != so, "dlopen failed: \"%s\".", ::dlerror() ); - return so; + return ::dlopen(_filePath.getCPtr(), RTLD_LOCAL|RTLD_LAZY); #endif // BX_PLATFORM_ } void dlclose(void* _handle) { - if (NULL == _handle) - { - return; - } - #if BX_PLATFORM_WINDOWS ::FreeLibrary( (HMODULE)_handle); #elif BX_PLATFORM_EMSCRIPTEN \ @@ -215,7 +206,7 @@ namespace bx { const int32_t symbolMax = _symbol.getLength()+1; char* symbol = (char*)alloca(symbolMax); - strCopy(symbol, symbolMax, _symbol); + bx::strCopy(symbol, symbolMax, _symbol); #if BX_PLATFORM_WINDOWS return (void*)::GetProcAddress( (HMODULE)_handle, symbol); @@ -235,7 +226,7 @@ namespace bx { const int32_t nameMax = _name.getLength()+1; char* name = (char*)alloca(nameMax); - strCopy(name, nameMax, _name); + bx::strCopy(name, nameMax, _name); #if BX_PLATFORM_WINDOWS DWORD len = ::GetEnvironmentVariableA(name, _out, *_inOutSize); @@ -273,14 +264,14 @@ namespace bx { const int32_t nameMax = _name.getLength()+1; char* name = (char*)alloca(nameMax); - strCopy(name, nameMax, _name); + bx::strCopy(name, nameMax, _name); char* value = NULL; if (!_value.isEmpty() ) { int32_t valueMax = _value.getLength()+1; value = (char*)alloca(valueMax); - strCopy(value, valueMax, _value); + bx::strCopy(value, valueMax, _value); } #if BX_PLATFORM_WINDOWS @@ -350,7 +341,7 @@ namespace bx int32_t len = 0; for(uint32_t ii = 0; NULL != _argv[ii]; ++ii) { - len += snprintf(&temp[len], uint32_imax(0, total-len) + len += snprintf(&temp[len], bx::uint32_imax(0, total-len) , "%s " , _argv[ii] ); @@ -379,9 +370,4 @@ namespace bx #endif // BX_PLATFORM_LINUX || BX_PLATFORM_HURD } - void exit(int32_t _exitCode) - { - ::exit(_exitCode); - } - } // namespace bx |