lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Under Microsoft Visual Studio 2008 in a typical new project, Lua
5.2.0-work3 does not compile because the preprocessor name UNICODE is
defined, and for example GetModuleFileName used in loadlib.c is mapped
to GetModuleFileNameW, which is incompatible with the char* argument.

This problem is not new, I have found several threads in the mailing
list talking about that, like in
http://lua-users.org/lists/lua-l/2006-08/msg00041.html

Looking at the various versions, I noticed that Lua 5.1 and Lua 5.1.1
used GetModuleFileName in loadlib.c, while 5.1.2, 5.1.3 and 5.1.4 have
switched to GetModuleFileNameA. But 5.2.0-work1 to work3 uses
GetModuleFileName again!

I don't understand the reason, so it is most probably a mistake.
So please, could you change the following names in loadlib.c for the
next work version:
[148]: GetModuleFileName => GetModuleFileNameA
[162]: FormatMessage => FormatMessageA
[175]: LoadLibraryEx => LoadLibraryExA