A Few thoughts on C, C++, and D

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 1 05:04:40 PDT 2017


On 2017-06-01 10:25, Ola Fosheim Grøstad wrote:

> Even though a stand-alone tool is just as good in theory I think most
> developers want as hassle free builds as possible. If one can just point
> to the OS include directory and import directly that would be very neat.

Currently DStep will just ignore everything in the body of a 
preprocessor if statement where the condition is false, just like the 
regular compiler. For example, running DStep on a header file with the 
following content:

#ifdef _WIN32
char foo();
#else
int foo();
#endif

Will produce on non-Windows platforms:

extern (C):

int foo ();

So DStep works, just that will generate platform specific bindings.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list