[Issue 22553] ImportC: undefined identifier `__uint128_t`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 2 19:28:56 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22553

--- Comment #2 from dave287091 at gmail.com ---
(In reply to Walter Bright from comment #1)
> Unfortunately, DMD does not support 128 bit integers.
> 
> Not sure what to do about this, can it be #define'd away with a macro?

It’d be nice to support 128 bit integers. Some algorithms require a 128 bit
multiply.

As far as I can tell, they are used in struct definitions that are used to save
the arm neon registers if someone uses the deprecated <ucontext.h> api. The
actual usage is here:

struct __darwin_arm_neon_state64
{
 __uint128_t __v[32];
 __uint32_t __fpsr;
 __uint32_t __fpcr;
};

struct __darwin_arm_neon_state
{
 __uint128_t __v[16];
 __uint32_t __fpsr;
 __uint32_t __fpcr;
};

They seem to only be included into <stdlib.h> as it includes machine specific
types, even though it doesn’t actually use them.

Possibly you could fake it with something like this:

struct fake_u128  {
    _Alignas(16) unsigned long long a;
    unsigned long long b;
};
#define __uint128_t struct fake_u128

--


More information about the Digitalmars-d-bugs mailing list