Tom N Harris <telliamed@...> writes:

> 
> The Windows SDK already gives you a default value if you don't define it 
> before including <windows.h>. So the correct default for a build system is 
> nothing at all.
> 

This value doesn't belong to system at all.
I have simple test.c file
  #include <Windows.h>
  #include <stdio.h>
  void main(void){printf("0x0%x", WINVER);}

 On my Windows XP i have:
 - VS2010Express/VS2008 (cl test.c & test.exe) i got `0x600` (this is Vista)
 - MinGW32 (gcc test.c & a.exe) i got `0x0400` (this is NT4)

> I don't like the idea. Why can't the people who want an unusual WINVER just 
> put it the -DWINVER=0x501 cflag in their site config? A rock that expect a 
> minumum version will define the macro in its source.
> 
> There are too many compiler and API specific flags like this for LR to start 
> getting involved with. i.e. UNICODE, LARGE_FILE_SOURCE, etc. 
> 

I do not want have constant version in rockspec.
I want to get version number of system on which my module will be run.
Lurocks do not provide way to discovery system on which it installed.
Some functionality depend on Windows major version, some depend on version of SP
and some even depend on version of internet explorer.
And i do not insist that luarock should provide bultin WINVER variable.
But it should provide way to determinate such runtime variables.
I think different between `UNICODE` macro and `WINVER` macro is
`WINVER` describe API version, `UNICODE` serve to configure specific API.

I think to support this behavior in general we need ability to write our own
function.
And this is not good idea for luarocks builtin buld system because of
rockspec format provide only declarative way.
May be the better way for such module is use different build system (e.g. lake).
But _WIN32_WINNT/WINVER is very common macro and i think luarocks could
support it.

This is my dirty way to get WINVER value (i do not think luarocks really
need NTDDI_VERSION): 
https://gist.github.com/moteus/6350481



------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to