What on earth is std.windows.d?

Don Clugston dac at nospam.com.au
Sat Mar 4 12:01:51 PST 2006


jcc7 wrote:
>>> Don Clugston wrote:
>> I've been inspired to have a go at making a C2D header converter. I know 
>> that's been done before, but this one's in D.

> Please keep us updated on this. I think the D community is really hungry for a
> C2D program written in D. I know I'd like to have such a tool in my toolbelt.

I think this is crucial. We can't possibly maintain D bindings for all 
the zillions of C libraries out there, if it's being done manually.

> (I'm sure some things will always need to be converted manually, but whatever
> can be converted automatically lets the humans save their time for more
> interesting pursuits.)

I think a 100% automatic conversion is practically impossible, basically 
because #define is such an ambiguous language construct. eg is
#define FOO 1
defining a constant int? Or is it a flag for a later #ifdef in this 
file? Or in another file?

My idea is to have a tool that takes a header file and a very short 
"hints" file, specific to that SDK, which, in an organised format, lists 
*all* the "manual" changes that need to be made, so that they can be 
done automatically.
Provided the header file doesn't change radically between releases, it 
should be possible to use the same hints file to keep D headers up to 
date with C ones, without any extra work.

It also means that we'd only need to distribute the hints files. Eg, get 
your copy of the Windows SDK by any legitimate means (eg from your C++ 
compiler or MSDN subscription). Run c2d on it, with this hint file. Then 
everyone gets the same files, but without violating licenses.




More information about the Digitalmars-d mailing list