Suggestion to use common Win32 headers

Don Clugston dac at nospam.com.au
Thu Mar 6 05:43:37 PST 2008


bobef wrote:
> Hi guys,
> 
> I run into this problem often. Each [win32] library uses its own win32 headers, typically only what it needs. For example - phobos has some common headers, tango has some minimal win32 headers, dfl has its own, dwt has its own, etc... So if you use more than one of these libraries you run into conflicts. On top of that their win32 headers support is limited and you need yet another headers (which cause even more conflicts) or do what they do - manually copy paste from msdn, which sucks :) 

That is exactly why the win32 project was begun -- the current situation is 
ridiculous.

> So how could this be solved? By the adoption of full set of the win32 headers by the both standard libraries - phobos and tango. Such comprehensive set of headers exists in the dsource/bindings/win32 project. So if these headers are present in the std lib, the the other major libraries like dfl, dwt, etc would not need to redefine the win32 api and one would be able to use the same headers which these libraries use, so you won't run into conflicts like void(HANDLE,UINT) does not match void(HANDLE,UINT).

A few important points:
1. IIRC, Walter has permission from Microsoft to redistribute the Windows headers.
2. The headers in the Win32 project weren't used because all the values declared 
as 'const' were stored in the obj files. Because of this, D2.0 introduced syntax 
for manifest constants (using 'enum' -- an unpopular choice, but it does provide 
the functionality).
3. Another annoyance is that the .lib files that come with the compiler are 
incomplete and date from an old version of Windows.

It seems to be easy to fix (3) at least -- Walter just needs to download the 
latest WinSDK, run coffimplib on each .lib file, then add them to the distribution.



More information about the Digitalmars-d mailing list