ImportC and #pragma pack
Guillaume Piolat
first.name at notexisting.com
Tue Sep 28 12:54:39 UTC 2021
On Tuesday, 28 September 2021 at 08:54:00 UTC, max haughton wrote:
> On Tuesday, 28 September 2021 at 06:30:09 UTC, Elronnd wrote:
>> On Tuesday, 28 September 2021 at 06:05:04 UTC, Walter Bright
>> wrote:
>>> How far do we go with implementing all the nutburger obsolete
>>> C extension cruft out there?
>>
>> The whole point of importc is compatibility, no? So I say:
>> all the way.
>
> Compatibility with what? Are there projects using pragma pack
> as part of a stable API?
Absolutely.
For example the VST3 SDK
https://github.com/steinbergmedia/vst3_pluginterfaces/blob/b8566ef3b2a0cba60a96e3ef2001224c865c8b36/base/falignpush.h
This header is then included before every struct definition.
It's very easy after a D translation to have an ABI problem
because of this, so SDK writers have written sizeof checks.
More information about the Digitalmars-d
mailing list