[SAOC 2025] Improve importC Weekly Update #7

Emmanuel emmankoko519 at gmail.com
Mon Nov 3 18:42:07 UTC 2025


Hi everyone,

I finally closed down the fixes on using macros that point to 
identifiers from D That was reported by Atila.

D aliases created for those macros skips a bit of the normal 
alias semantics in D. like allowing it to reference itself and 
not make noise when we cannot resolve it. but it just won't allow 
it at runtime. initially, I had kept a builtin table for a large 
number of macros that was breaking changes.

I had to do a lot of research in lots of the macros and also 
compiler and platform differences.
I had a tough time with the C99 "complex" system on windows that 
was creating some conflicts with D runtimes complex module. so 
many address sanitizer macros causing a lot of discomfort. 
Microsoft hasn't been friendly to importC.

I have a working PR now. we can use macros that refer to 
identifiers now.

https://github.com/dlang/dmd/pull/22056

I need to get ready for my next fight with macros that point to 
functions.

for a #define number getnumber(), I dare not set the function as 
an initializer. ctfe problems.
maybe a global variable assigned to the function in a static 
this. ready for my next fight.
My mentor has been super helpful.




More information about the Digitalmars-d mailing list