mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
FFI: Fix GetLastError() save/restore around ffi.load().
This commit is contained in:
parent
c2dcf39ee3
commit
90c445851f
@ -185,8 +185,8 @@ static void *clib_loadlib(lua_State *L, const char *name, int global)
|
|||||||
{
|
{
|
||||||
DWORD oldwerr = GetLastError();
|
DWORD oldwerr = GetLastError();
|
||||||
void *h = (void *)LoadLibraryA(clib_extname(L, name));
|
void *h = (void *)LoadLibraryA(clib_extname(L, name));
|
||||||
SetLastError(oldwerr);
|
|
||||||
if (!h) clib_error(L, "cannot load module " LUA_QS ": %s", name);
|
if (!h) clib_error(L, "cannot load module " LUA_QS ": %s", name);
|
||||||
|
SetLastError(oldwerr);
|
||||||
UNUSED(global);
|
UNUSED(global);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user