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.
This commit is contained in:
Niels Martin Hansen 2009-04-17 20:20:37 +00:00
parent cc26be476e
commit b6ae30cc6c
1 changed files with 2 additions and 2 deletions

View File

@ -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);