ImportC and #pragma pack

Guillaume Piolat first.name at notexisting.com
Wed Sep 29 00:11:02 UTC 2021


On Tuesday, 28 September 2021 at 23:54:52 UTC, Walter Bright 
wrote:
>
> Of course that will fail, just like it will fail if you compile 
> code with TinyCC's stdlib and link with clang's stdlib.

I now realize that using D, it was "just working" because of work 
that went into DRuntime to avoid ABI problems:
https://github.com/dlang/druntime/blob/a17bb23b418405e1ce8e4a317651039758013f39/src/core/sys/posix/dirent.d#L53

So the current state is that: the D compiler works will all 
(supported) C runtime, with a single set of D headers.

This won't be the case in an ImportC future, your build will 
depend on pointing on the right libc include paths (unless there 
is a similar syncretic header set that works with common libc), 
and I just hope the compiler will do it automatically :)



More information about the Digitalmars-d mailing list