Thread overview
[Issue 23614] ImportC: __int128 not supported
Jan 09, 2023
Jacob Carlborg
Jan 09, 2023
Walter Bright
Jan 09, 2023
Walter Bright
Jan 10, 2023
Jacob Carlborg
Jan 10, 2023
Jacob Carlborg
Jan 10, 2023
Jacob Carlborg
Jan 12, 2023
Walter Bright
Jan 12, 2023
Dlang Bot
Jan 14, 2023
Dlang Bot
Jan 14, 2023
Dlang Bot
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

Jacob Carlborg <doob@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ImportC

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
At least a better error message:

https://github.com/dlang/dmd/pull/14797

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
Do you really need this function, or is it just something in the header? Does the header have an #if alternative path in it?

--
January 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

--- Comment #3 from Jacob Carlborg <doob@me.com> ---
(In reply to Walter Bright from comment #2)
> Do you really need this function, or is it just something in the header? Does the header have an #if alternative path in it?

No, I see now that it's guarded with __SIZEOF_INT128__. Adding `#undef __SIZEOF_INT128__` in "importc.h" works.

--
January 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

--- Comment #4 from Jacob Carlborg <doob@me.com> ---
Here's the full preprocessor logic:

#if !defined BR_INT128 && !defined BR_UMUL128
#ifdef __SIZEOF_INT128__
#define BR_INT128    1
#elif _M_X64
#define BR_UMUL128   1
#endif
#endif

Then rest of the code checks for "BR_INT128" and "BR_UMUL128". Perhaps "_M_X64" should be undefined as well.

--
January 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

--- Comment #5 from Jacob Carlborg <doob@me.com> ---
(In reply to Jacob Carlborg from comment #4)
> Here's the full preprocessor logic:
> 
> #if !defined BR_INT128 && !defined BR_UMUL128
> #ifdef __SIZEOF_INT128__
> #define BR_INT128    1
> #elif _M_X64
> #define BR_UMUL128   1
> #endif
> #endif
> 
> Then rest of the code checks for "BR_INT128" and "BR_UMUL128". Perhaps "_M_X64" should be undefined as well.

It's available here [1]. I'm trying to compile BearSSL [2]. I'm just running DMD on the files in the "src" directory and reporting issues as I find them.

It's quite a bit problematic that the Clang preprocessor is used, which supports a bunch of extensions that DMD doesn't support.

[1] https://bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/inner.h;h=07e1d0a478e801a91580658918130fb8b595e407;hb=HEAD#l403

[2] https://bearssl.org/#download-and-installation

--
January 12, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> ---
Thanks, this is what I need to know.

--
January 12, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #14805 "fix Issue 23614 - ImportC: __int128 not supported" fixing this issue:

- fix Issue 23614 - ImportC: __int128 not supported

https://github.com/dlang/dmd/pull/14805

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14805 "fix Issue 23614 - ImportC: __int128 not supported" was merged into stable:

- 2e02e183729d6648130b4fbcbf73b64f5d5cd080 by Walter Bright:
  fix Issue 23614 - ImportC: __int128 not supported

https://github.com/dlang/dmd/pull/14805

--
January 14, 2023
https://issues.dlang.org/show_bug.cgi?id=23614

--- Comment #9 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14815 "Merge stable" was merged into master:

- ee3176917dc4edc466ce10676f1f8336267341ba by Walter Bright:
  fix Issue 23614 - ImportC: __int128 not supported (#14805)

https://github.com/dlang/dmd/pull/14815

--