Skip to content

Commit bf2b30d

Browse files
authored
Merge pull request #107 from antoniovazquezblanco/fix
util/win32-dlfcn: Fix compilation errors.
2 parents 8bac882 + 1b6cba5 commit bf2b30d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

util/win32-dlfcn.imp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <errno.h>
2525
#include <windows.h>
2626

27-
SUPRIVATE dlfcn_error_state g_dlfcn_state;
27+
SUPRIVATE struct dlfcn_error_state g_dlfcn_state;
2828

2929
SUPRIVATE void
3030
dl_set_last_error(const char *fmt, ...)
@@ -55,7 +55,7 @@ dlclose(void *handle)
5555
{
5656
int ret = 0;
5757

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

72-
proc = GetProcAddress(SCAST(HINSTANCE, handle), name);
73-
asPtr = reinterpret_cast<void *>(proc);
72+
proc = GetProcAddress(SUCAST(HINSTANCE, handle), name);
73+
asPtr = (void *)proc;
7474

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

7878
return asPtr;
7979
}
8080

81-
char *
81+
const char *
8282
dlerror()
8383
{
8484
const char *error = g_dlfcn_state.last_error;

0 commit comments

Comments
 (0)