fixing mingw errors
VoidLoader/VoidLoaderCore/pipeline/head There was a failure building this commit
VoidLoader/VoidLoaderCore/pipeline/head There was a failure building this commit
Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
1 file changed
+4
-4
@@ -4,7 +4,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||||
static int32_t __wtf8_decode1(const char** input) {
|
static int32_t __wtf8_decode1(const char** input) {
|
||||||
uint32_t code_point;
|
uint32_t code_point;
|
||||||
uint8_t b1;
|
uint8_t b1;
|
||||||
@@ -98,17 +98,17 @@ void* LoadLibrary(const std::string& path, bool isGlobal)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
if ((size_t) r > ARRAY_SIZE(filename_w))
|
if ((size_t) r > ARRAY_SIZE(filename_w))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
_wtf8_to_utf16(path.c_str(), filename_w, r);
|
wtf8_to_utf16(path.c_str(), filename_w, r);
|
||||||
|
|
||||||
return LoadLibraryExW(filename_w, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
return LoadLibraryExW(filename_w, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||||
}
|
}
|
||||||
bool CloseLibrary(void* handle)
|
bool CloseLibrary(void* handle)
|
||||||
{
|
{
|
||||||
return FreeLibrary(handle) != 0;
|
return FreeLibrary(static_cast<HMODULE>(handle)) != 0;
|
||||||
}
|
}
|
||||||
void* LoadSymbol(void* handle, const std::string& name)
|
void* LoadSymbol(void* handle, const std::string& name)
|
||||||
{
|
{
|
||||||
return (void*)(uintptr_t) GetProcAddress(handle, name.c_str());
|
return (void*)(uintptr_t) GetProcAddress(static_cast<HMODULE>(handle), name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user