From 9f48712c15aba8fd48f9d2e93195ed84e69f8f90 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 13 Jun 2010 16:36:17 -0300 Subject: [PATCH] use ANSI versions of DLL functions in Windows --- loadlib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loadlib.c b/loadlib.c index ec3b842b..3087d264 100644 --- a/loadlib.c +++ b/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.82 2010/03/19 15:02:34 roberto Exp roberto $ +** $Id: loadlib.c,v 1.83 2010/05/31 16:34:19 roberto Exp roberto $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -145,7 +145,7 @@ static void setprogdir (lua_State *L) { char buff[MAX_PATH + 1]; char *lb; DWORD nsize = sizeof(buff)/sizeof(char); - DWORD n = GetModuleFileName(NULL, buff, nsize); + DWORD n = GetModuleFileNameA(NULL, buff, nsize); if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) luaL_error(L, "unable to get ModuleFileName"); else { @@ -159,7 +159,7 @@ static void setprogdir (lua_State *L) { static void pusherror (lua_State *L) { int error = GetLastError(); char buffer[128]; - if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, + if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, buffer, sizeof(buffer), NULL)) lua_pushstring(L, buffer); else @@ -172,7 +172,7 @@ static void ll_unloadlib (void *lib) { static void *ll_load (lua_State *L, const char *path, int seeglb) { - HMODULE lib = LoadLibraryEx(path, NULL, LUA_LLE_FLAGS); + HMODULE lib = LoadLibraryExA(path, NULL, LUA_LLE_FLAGS); (void)(seeglb); /* symbols are 'global' by default? */ if (lib == NULL) pusherror(L); return lib;