Why do we still need/use .di 'header' files?
daniel.keep.lists at gmail.com
Fri Nov 17 12:48:51 PST 2006
> Don Clugston wrote:
>> What about templates, and conditional compilation?
> if you are taking about closed source libs, that isn't an issue. It
> would be nice to have a tool that would walk a .o/.a/.lib file (that
> doesn't come with source) and generate a .di file that lets you link to it.
> Just dreaming I guess.
If the object file was compiled by D, it shouldn't be too hard. As Don
said, you won't get templates, conditional compilation switches,
protection attributes, etc., but it should work in general.
But if that bugger's got C linkage, forget it. C linkage tells you the
name and nothing more. And since in C the callee cleans up the stack,
you can't even reliably disassemble the ASM to work out what kinds of
arguments it takes (at least, not to my knowledge.)
Maybe what would work is if we defined a wrapper format, like DDL files,
that takes the generated object file (of whatever format the native
machine supports), and wraps it with additional information.
That, or we could just get DDL built into the standard D toolchain.
(Also just dreaming :P)
Unlike Knuth, I have neither proven or tried the above; it may not even
More information about the Digitalmars-d-learn