Thread overview
importC int128 support timeline and other problem
Aug 30
Dakota
Aug 30
Dakota
August 30

The problem list:

importC Error: unsigned __int128 not supported

importC error: _Builtin_stddef

inportC with postgres 16_4 on macOS error

no definition of struct `mach_vm_range

importC error: alignment value expected, not sizeof

importC with struct name and function conflict

the most important one is int128 support, I am not sure when it will be support or ever will be supported. or there will be workaround.

If it takes more than half a year, I will give up.

August 30

On Friday, 30 August 2024 at 06:31:27 UTC, Dakota wrote:

>

the most important one is int128 support, I am not sure when it will be support or ever will be supported. or there will be workaround.

Does your hardware support it? That message looks like the C preprocessor telling you it's not supported on your machine.

https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html

August 30

On Friday, 30 August 2024 at 08:54:54 UTC, Lance Bachmeier wrote:

>

On Friday, 30 August 2024 at 06:31:27 UTC, Dakota wrote:

>

the most important one is int128 support, I am not sure when it will be support or ever will be supported. or there will be workaround.

Does your hardware support it? That message looks like the C preprocessor telling you it's not supported on your machine.

https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html

This error is report by dmd or ldc with importC, I guess it cause by d can not handle int128 type.

August 30

On Friday, 30 August 2024 at 10:38:23 UTC, Dakota wrote:

>

On Friday, 30 August 2024 at 08:54:54 UTC, Lance Bachmeier wrote:

>

On Friday, 30 August 2024 at 06:31:27 UTC, Dakota wrote:

>

the most important one is int128 support, I am not sure when it will be support or ever will be supported. or there will be workaround.

Does your hardware support it? That message looks like the C preprocessor telling you it's not supported on your machine.

https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html

This error is report by dmd or ldc with importC, I guess it cause by d can not handle int128 type.

https://dlang.org/spec/importc.html#preprocessor

"ImportC does not have a preprocessor. It is designed to compile C files after they have been first run through the C preprocessor...If the C file has a .c extension, ImportC will run the preprocessor for it automatically."

August 30

On Friday, 30 August 2024 at 06:31:27 UTC, Dakota wrote:

>

no definition of struct `mach_vm_range

I responded in that message, I had filed a bug report on it a few days ago. This reminds me, I should actually mention the exact message so others find that same issue. It took me a while to boil down what the exact problem was.

You should also file bug reports for all your issues if they aren't already in bugzilla. That's the only way they will get noticed and fixed. People have various different machines and C compilers, so Walter and whomever else is working on importC can't discover them all.

-Steve

August 30
You're in luck! Phobos has an int128 type:

https://dlang.org/phobos/std_int128.html

The primitives are implemented in core.int128:

https://dlang.org/phobos/core_int128.html
August 30
On 8/29/2024 11:31 PM, Dakota wrote:
> The problem list:

Thank you for taking the time to posting them. May I suggest that the learn subgroup is only for people asking how to do things in D.

The best way to report bugs is via our bug reporting system (!):

https://issues.dlang.org/

which keeps track of issues until they get resolved, unlike the newsgroups where things scroll away and get forgotten.

Remember to tag ImportC issues with the ImportC keyword!
August 30

On Friday, 30 August 2024 at 19:58:23 UTC, Walter Bright wrote:

>

You're in luck! Phobos has an int128 type:

https://dlang.org/phobos/std_int128.html

The primitives are implemented in core.int128:

https://dlang.org/phobos/core_int128.html

Will that work with unsigned int128 (the problem here)? If so, that could maybe go in here: https://github.com/dlang/dmd/blob/master/druntime/src/__importc_builtins.di

August 30
On 8/30/2024 2:14 PM, Lance Bachmeier wrote:
> Will that work with unsigned int128 (the problem here)? If so, that could maybe go in here: https://github.com/dlang/dmd/blob/master/druntime/src/__importc_builtins.di

Oddly, std.int128 only does signed operations. core.int128 does both signed and unsigned.