ImportC now supports function-like macros

Alex Bryan abryancs at gmail.com
Tue Feb 20 02:11:36 UTC 2024


On Tuesday, 20 February 2024 at 02:07:45 UTC, Walter Bright wrote:
> #importc now successfully converts function-like C macros to 
> #dlang function templates:
>
> ```C
> #define ADD(a, b) a + b
> ```
>
> is converted to a D function template:
>
> ```D
> auto ADD(T1, T2)(T1 a, T2 b) { return a + b; }
> ```
>
> which opens up a lot more automatic support for C macro use.
>
> https://github.com/dlang/dmd/pull/16199
>
> Thanks to @ibuclaw, @dkorpel, @thewilsonator, @Herringway, 
> @ntrel, @tim-dlang for helping me get it over the finish line.

Yes!!!! Thanks to all for all of the hard work


More information about the Digitalmars-d mailing list