Why do we still need/use .di 'header' files?

Daniel Keep daniel.keep.lists at gmail.com
Fri Nov 17 12:48:51 PST 2006



BCS wrote:
> 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.)

<2>

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)

</2>

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d-learn mailing list