www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D Imports and Shared Library question

reply Shammah Chancellor <Shammah_member pathlink.com> writes:
While I understand you can strip the function bodies out an get the same effect
as header files in C, I don't 
think this was the design goal. My understanding was that you could "import" the
original source directly 
as if it was a header file when using it to compile against a library.  What I'm
wondering is how the 
compiler decides when it needs to pay attention to, and staticly compile the
function definition, and when 
it just needs to know what they are.  So how's it do it?

-Sha
Aug 21 2005
parent Derek Parnell <derek psych.ward> writes:
On Sun, 21 Aug 2005 07:54:28 +0000 (UTC), Shammah Chancellor wrote:

 While I understand you can strip the function bodies out an get the same effect
 as header files in C, I don't 
 think this was the design goal. My understanding was that you could "import"
the
 original source directly 
 as if it was a header file when using it to compile against a library.  What
I'm
 wondering is how the 
 compiler decides when it needs to pay attention to, and staticly compile the
 function definition, and when 
 it just needs to know what they are.  So how's it do it?

If its on the DMD command line it compiles it, otherwise it just reads it. -- Derek Parnell Melbourne, Australia 21/08/2005 7:33:52 PM
Aug 21 2005