ImportC has improved macro support

Paolo Invernizzi paolo.invernizzi at gmail.com
Sat Dec 9 10:36:50 UTC 2023


On Friday, 8 December 2023 at 05:17:30 UTC, Ki Rill wrote:
> On Wednesday, 6 December 2023 at 19:59:54 UTC, Walter Bright 
> wrote:
>> Macros with the pattern:
>>
>>     #define BOO ( expression )
>>
>> are now translated to:
>>
>>     auto BOO()() { return expression; }
>>
>> and are available for importing!
>
> This is amazing! It should solve the disappearing of enum-like 
> definitions in code. I encountered this in Raylib. It has 
> colors defined as macros:
>
> ```c
> #define WHITE (Color){255, 255, 255, 255}
> ```
>
> I preprocessed the file and all color definitions were gone. I 
> had to redefine them manually.
>
> Nuklear does the same too for their Flags.

Same situation here, with RayLib!
I really really like the way importC is improving, kudos to 
Walter!

/Paolo


More information about the Digitalmars-d-announce mailing list