Yet another effort at translating the Win32 API headers

xs0 xs0 at xs0.com
Wed Mar 29 06:25:00 PST 2006


Stewart Gordon wrote:
> xs0 wrote:
> <snip>
>> I think that the system is like this:
>>
>> _WIN32_WINDOWS is defined only for Win95/98/Me (the crappy ones)
>> _WIN32_WINNT is defined only for Win NT4/2k/XP/Vista/... (the OK ones)
> 
> When one writes a Windows application, it is often hoped that it will 
> work on both lines of Windows.

You're absolutely right :)

>> WINVER is defined for all Windows, and equals _WIN32_* for any given OS.
>>
>> Now, the above condition does have to use an ||, as it's never the 
>> case that both are defined. It's also true that it could simply be (in 
>> this case)
> <snip>
> 
> So I'm writing my program for both Windows 98 and Windows 2000, what 
> versions should I set?

both
_WIN32_WINDOWS=0x0410
and
_WIN32_WINNT=0x0500

I was obviosuly wrong in saying that both are never defined :) I should 
get more sleep before posting next time. It should still be ||, though, 
because otherwise you'd always have to declare both, and there's no real 
need.

BTW, wouldn't something like this work for CC:

version(WINAPI_98) {
     version=WINAPI_95;
}

version(WINAPI_ME) {
     version=WINAPI_98;
     version=WINAPI_95;
}

version(WINAPI_95) {
     // win 95 funcs
}

version(WINAPI_98) {
     // funcs new in Win 98
}

version(WINAPI_ME) {
     // funcs new in Win Me
}


Then, when compiling, you can set the api version you want with 
-version=?. If you don't set it, it should probably default to the 
latest known version?


xs0



More information about the Digitalmars-d-announce mailing list