www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - importC int128 support timeline and other problem

reply Dakota <dakota gmail.com> writes:
The problem list:


[importC Error: unsigned __int128 not 
supported](https://forum.dlang.org/post/gszrquconihrheekkxes forum.dlang.org)

[importC error: _Builtin_stddef 
](https://forum.dlang.org/thread/gohvdcxmcgftglrmohjp forum.dlang.org)


[inportC with postgres 16_4 on macOS 
error](https://forum.dlang.org/thread/lwndouyzgfojdpoxzyko forum.dlang.org)


[no definition of struct 
`mach_vm_range](https://forum.dlang.org/post/tpebcqwzdqfkhnlkmbpd forum.dlang.org)

[importC error: alignment value expected, not 
`sizeof`](https://forum.dlang.org/thread/yesaxwhyountswygbiua forum.dlang.org)


[importC with struct name and function 
conflict](https://forum.dlang.org/thread/bmntorbovfaatfptukjp forum.dlang.org)


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.
Aug 29
next sibling parent reply Lance Bachmeier <no spam.net> writes:
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
Aug 30
parent reply Dakota <dakota gmail.com> writes:
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.
Aug 30
parent Lance Bachmeier <no spam.net> writes:
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."
Aug 30
prev sibling next sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On Friday, 30 August 2024 at 06:31:27 UTC, Dakota wrote:

 [no definition of struct 
 `mach_vm_range](https://forum.dlang.org/post/tpebcqwzdqfkhnlkmbpd forum.dlang.org)
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
Aug 30
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
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
Aug 30
parent reply Lance Bachmeier <no spam.net> writes:
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
Aug 30
parent Walter Bright <newshound2 digitalmars.com> writes:
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.
Aug 30
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
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!
Aug 30