Translating C macros to D

Atila Neves via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 11 04:40:23 PDT 2017


On Tuesday, 11 July 2017 at 06:51:33 UTC, Jacob Carlborg wrote:
> On 2017-07-11 03:31, Cym13 wrote:
>
>> Is not getting rid of the macro an option? By that I mean 
>> translating the code inside the macro (which can admitedly be 
>> hard because it doesn't have to be semanticaly correct code 
>> due to concatenations but most macros aren't so evil) and add 
>> a pass of cpp to the build.
>
> Not sure I fully understand. Could you give a concrete example? 
> BTW, it might not be possible if the macros are part of the API 
> and we want to keep the D API as close as possible to the C API.

And in my experience any non-trivial C API requires the 
pre-processor.

Atila


More information about the Digitalmars-d mailing list