From e977f3c991f916110802564d696b84d46793d2c5 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Fri, 17 Apr 2009 20:20:37 +0000 Subject: [PATCH] Force use of ANSI versions of Windows API's for runtime+loading of DLL's, causing problems when building with UNICODE defined. Originally committed to SVN as r2815. --- contrib/lua50/src/lib/loadlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/lua50/src/lib/loadlib.c b/contrib/lua50/src/lib/loadlib.c index ac4d697a6..0cba2fc38 100644 --- a/contrib/lua50/src/lib/loadlib.c +++ b/contrib/lua50/src/lib/loadlib.c @@ -96,7 +96,7 @@ 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, 0, error, 0, buffer, sizeof(buffer), 0)) lua_pushstring(L,buffer); else @@ -107,7 +107,7 @@ static int loadlib(lua_State *L) { const char *path=luaL_checkstring(L,1); const char *init=luaL_checkstring(L,2); - HINSTANCE lib=LoadLibrary(path); + HINSTANCE lib=LoadLibraryA(path); if (lib!=NULL) { lua_CFunction f=(lua_CFunction) GetProcAddress(lib,init);