Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions util/win32-dlfcn.imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <errno.h>
#include <windows.h>

SUPRIVATE dlfcn_error_state g_dlfcn_state;
SUPRIVATE struct dlfcn_error_state g_dlfcn_state;

SUPRIVATE void
dl_set_last_error(const char *fmt, ...)
Expand Down Expand Up @@ -55,7 +55,7 @@ dlclose(void *handle)
{
int ret = 0;

if (!FreeLibrary(SCAST(HINSTANCE, handle))) {
if (!FreeLibrary(SUCAST(HINSTANCE, handle))) {
dl_set_last_error("FreeLibrary: %s", GetLastError());
ret = -1;
}
Expand All @@ -69,16 +69,16 @@ dlsym(void *handle, const char *name)
FARPROC proc;
void *asPtr;

proc = GetProcAddress(SCAST(HINSTANCE, handle), name);
asPtr = reinterpret_cast<void *>(proc);
proc = GetProcAddress(SUCAST(HINSTANCE, handle), name);
asPtr = (void *)proc;

if (asPtr == nullptr)
dl_set_last_error("GetProcAddress: %s", GetLastError());

return asPtr;
}

char *
const char *
dlerror()
{
const char *error = g_dlfcn_state.last_error;
Expand Down
Loading