Or just include windows.h where it is needed in loadlib.c under #elif
defined(LUA_DL_DLL) and not in the luaconf.h file.
Works without problems for me.
Much better. windows.h is a serious kitchen-sink header.
Agreed. #include <windows.h> has no business out in my public header chain.
Indeed.
I've expected that, at least, it would be framed by #if
defined(LUA_CORE) checks, but no, it goes right to public. Nasty.
Furthermore, I remember that including windows.h without extra defines
is a bad idea.
When I coded for Windows, I always used to do at least this:
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
Much less hassle. (Especially without min and max defined as macroses.)
Also, this (outdated) article suggests there can be even more useful defines:
http://support.microsoft.com/kb/166474
Perhaps some Win32 guru would enlighten us more?
Alexander.