lua-users home
lua-l archive

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

> And it seems to work fine...
With respect, it has not been tested under the near infinity of windows build configurations. My most hated phrase in software development is "yeah, but it works..." Having said that it would not the first library to have windows.h as something other than the first header. As far as I am aware the only module that requires windows.h is loadlib.c so why not restrict its usage to this module?

I will attempt to find some archived examples of failure for you over the coming weeks, right now I do not have the time.

Luiz Henrique de Figueiredo wrote:
1) if you are going to use windows.h it should be the first header, this is because the windows headers modify macros used by the RTL, I have read MS documentation on this (but cant remember where). This means that loadlib.c *needs* an in the module #ifdef to include windows.h as the first header. I vaguely remember specific problems with modules that include <io.h>, so in writing a Lua library for windows the header order is impoortant.

But in 5.1.4 windows.h is included after stdlib.h, string.h, lua.h, etc.
And it seems to work fine...