Yet another effort at translating the Win32 API headers
Stewart Gordon
smjg_1998 at yahoo.com
Wed Mar 29 04:36:55 PST 2006
Don Clugston wrote:
> Stewart Gordon wrote:
<snip>
>> Now, who's going to contribute?
>
> I hope that I can do a bit.
Excellent!
<snip>
>> Defining a set of version identifiers for the supported Windows
>> versions along the Win9x and WinNT lines is another possibility, but
>> it'll take a bit of work to determine how the #ifs should be converted.
>
> It's possible to use 'static if', now that it works at module scope.
>
> #if (WINVER > 0x4000)
> #else
> #endif
> can become
> static if (WINVER> 0x4000) {
> } else {
> }
>
> It's probably abuse of 'static if', but it should work as an interim
> solution.
Where would the user set WINVER? A module for the user to edit to
supply this data might be one possibility, but it would be a nightmare
for someone maintaining or even trying to compile several projects that
have different OS requirements. But for as long as it's only an interim
solution....
It would also be nice if the policy for using the versions is clearer
than the WINVER/_WIN32_WINDOWS/_WIN32_WINNT stuff is at the moment. At
the moment, I'm puzzled by the number of instances of this
#if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500)
or similar. It seems to be saying that the function may be used by
either an application that supports Win98 or an application that
supports Win2000. So you could have a program that works on Windows 98
and Windows NT4 but not Windows 95, or a program that works on Windows
95 and Windows 2000 but not Windows NT4, and whatever is in that #if
would be available to either. Unless I'm misunderstanding, it would
appear that the || should be an &&.
Stewart.
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS-
PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------
My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.
More information about the Digitalmars-d-announce
mailing list