Jump to page: 1 25  
Page
Thread overview
ImportC and #pragma pack
Sep 28, 2021
Walter Bright
Sep 28, 2021
Elronnd
Sep 28, 2021
bauss
Sep 28, 2021
max haughton
Sep 28, 2021
Guillaume Piolat
Sep 28, 2021
Walter Bright
Sep 28, 2021
Guillaume Piolat
Sep 28, 2021
Walter Bright
Sep 29, 2021
Guillaume Piolat
Sep 29, 2021
Walter Bright
Sep 28, 2021
rikki cattermole
Sep 28, 2021
jfondren
Sep 28, 2021
jfondren
Sep 28, 2021
russhy
Sep 28, 2021
Walter Bright
Sep 28, 2021
rikki cattermole
Sep 28, 2021
max haughton
Sep 28, 2021
Guillaume Piolat
Sep 28, 2021
Walter Bright
Sep 28, 2021
Guillaume Piolat
Sep 28, 2021
Walter Bright
Sep 29, 2021
Guillaume Piolat
Sep 29, 2021
Walter Bright
Sep 28, 2021
bachmeier
Sep 29, 2021
Imperatorn
Sep 30, 2021
Claude
Sep 30, 2021
Paulo Pinto
Sep 30, 2021
Guillaume Piolat
Sep 30, 2021
Paulo Pinto
Oct 02, 2021
Walter Bright
Sep 29, 2021
Kenneth Dallmann
Sep 29, 2021
Kenneth Dallmann
Sep 29, 2021
Kenneth Dallmann
Sep 30, 2021
Walter Bright
Sep 30, 2021
Dukc
Oct 01, 2021
Walter Bright
Oct 01, 2021
Imperatorn
Oct 01, 2021
Walter Bright
Oct 01, 2021
bauss
Oct 01, 2021
Imperatorn
Oct 04, 2021
Imperatorn
September 27, 2021
https://issues.dlang.org/show_bug.cgi?id=22315

I'm on the fence about implementing this. On the one hand, I can do it and make it work. On the other hand, the C11 way is to use _Alignas, and that's 10 years old now. How far do we go with implementing all the nutburger obsolete C extension cruft out there?
September 28, 2021
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.
September 28, 2021
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.

I second this, otherwise it's sort of pointless if it isn't entirely compatible.
September 28, 2021
Lua, sljit, zlib, xlib don't use it.

Got to page 10 on GH and didn't find anything that used it.

This can probably be tabled until we find a library that needs it.
September 28, 2021
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?
September 28, 2021
On Tuesday, 28 September 2021 at 06:05:04 UTC, Walter Bright wrote:
> https://issues.dlang.org/show_bug.cgi?id=22315
>
> I'm on the fence about implementing this. On the one hand, I can do it and make it work. On the other hand, the C11 way is to use _Alignas, and that's 10 years old now. How far do we go with implementing all the nutburger obsolete C extension cruft out there?

If it's not too much work I think you might as well implement it but an error/warning message must be issued if it is ignored.

__Import__ C must not lie about what it can or cannot do because (in the hands of 99% of its users) it is not going to be used as a C compiler, but rather a C compiler being deployed to properly consume C header files.
September 28, 2021

On Tuesday, 28 September 2021 at 08:35:57 UTC, rikki cattermole wrote:

>

Lua, sljit, zlib, xlib don't use it.

Got to page 10 on GH and didn't find anything that used it.

This can probably be tabled until we find a library that needs it.

$ grep -rl 'pragma pack' /usr/include/|cut -d/ -f4|sort -u

botan-2 clang dvdread f2fs_fs.h F3DAudio.h faaccfg.h faac.h FACT.h FAPOBase.h FAPOFX.h FAPO.h FAudioFX.h FAudio.h ffi.h gssapi krb5 libmodplug libusb-1.0 linux neaacdec.h nspr nss OpenEXR p11-kit-1 PCSC pgm-5.3 pkcs11 pkcs11-helper-1.0 qt quota.h SDL SDL2 smbios_c sodium unrar wine ykpers-1 zzip

SDL, qt (just one QtQml file, no idea how important it is), lotta media stuff, libusb, unrar, botan-2, two linux kernel headers.

September 28, 2021

On Tuesday, 28 September 2021 at 09:31:21 UTC, jfondren wrote:

>

SDL

SDL's some bizarre "what if someone includes me after a pack(1)?" code that could be removed, but others look more legit.

September 28, 2021

It's quite common to see #pragma pack used in gamedev libraries when you need to squeeze every little bit for performance

September 28, 2021
On Tuesday, 28 September 2021 at 06:05:04 UTC, Walter Bright wrote:
> https://issues.dlang.org/show_bug.cgi?id=22315
>
> I'm on the fence about implementing this. On the one hand, I can do it and make it work. On the other hand, the C11 way is to use _Alignas, and that's 10 years old now. How far do we go with implementing all the nutburger obsolete C extension cruft out there?

I tried ImportC with TCC and warp as preprocessor.
TCC stdlib uses #pragma pack also.
The conundrum with ImportC is that it seems to me you have to build with the right cstdlib headers if you intend to use this or that backend.
So in the end I managed to convert none of the STB headers libraries with ImportC (not only due to pragma pack).
« First   ‹ Prev
1 2 3 4 5