Is `__GNUC__` defined in dmd when using importC?
Dejan Lekic
dejan.lekic at gmail.com
Fri Oct 10 09:02:33 UTC 2025
On Friday, 10 October 2025 at 08:34:15 UTC, felixfxu wrote:
> Hi,
>
> I'm testing dmd's _importC_ in Ubuntu 24.04, my .c/.h code has
> many code specific to compilers, like
>
> #ifdef __GNUC__
>
> I'm surprise to see that it seems like `__GNUC__` is defined in
> dmd.
Reading the https://dlang.org/spec/importc.html will help you
solve the mystery. This section in particular:
https://dlang.org/spec/importc.html#preprocessor
More information about the Digitalmars-d-learn
mailing list