You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#23143 - importC: translate alias macros to aliases
A `#define ID identifier` whose body is a single declared identifier
(e.g. `#define mpz_init __gmpz_init` in gmp.h) was abandoned, leaving
the macro name undefined in D. Translate such object-like macros to
`alias ID = identifier;` so they resolve to the function/type/variable.
The target must be declared in the same translation unit (or an earlier
#define): aliasing an undefined identifier would error eagerly, which
system headers trigger by #define-ing keywords to compiler builtins
(e.g. `#define __func__ __FUNCTION__`, `#define __restrict restrict`).
Self-referential macros (glibc's `#define stdin stdin`) are skipped, as
they would otherwise shadow the declaration they name.
On Windows the C library's `complex` macro resolves to a struct, which
ImportC now aliases; druntime's `core.stdc.complex.complex` is an alias
of `creal`, so importc_compare flags the expected size difference - add
it to that test's known problems.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments