File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
2929SUPRIVATE void
3030dl_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 *
8282dlerror ()
8383{
8484 const char * error = g_dlfcn_state .last_error ;
You can’t perform that action at this time.
0 commit comments