Re: std.int128 not working with -betterC enabled

2023-12-22 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 23/12/2023 11:41 AM, Matheus Catarino wrote: Would there be any reason not to use |core.int128|? Currently, I used it to make a TigerbeetleDB client (Zig database) in D (betterC). https://github.com/batiati/tigerbeetle-clients-benchmarks/blob/f86216834bd04e1e06bede2a2e31b64df0dc98f1/d/modul

Re: std.int128 not working with -betterC enabled

2023-12-22 Thread Matheus Catarino via Digitalmars-d-learn
On Wednesday, 20 December 2023 at 18:16:00 UTC, Renato wrote: I wanted to write a small program using betterC that needs to use int128. This simple program works without -betterC: ```d module dasc; import std.int128; import core.stdc.stdio; extern (C): int main() { auto n = Int128(128, 12

Re: std.int128 not working with -betterC enabled

2023-12-20 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 21/12/2023 10:51 AM, Renato wrote: On Wednesday, 20 December 2023 at 19:11:15 UTC, Richard (Rikki) Andrew Cattermole wrote: Yes that is to be expected. It is not templated, and hasn't been compiled into your program. How do I compile that into my program? You copy the file from druntime

Re: std.int128 not working with -betterC enabled

2023-12-20 Thread Renato via Digitalmars-d-learn
On Wednesday, 20 December 2023 at 19:11:15 UTC, Richard (Rikki) Andrew Cattermole wrote: Yes that is to be expected. It is not templated, and hasn't been compiled into your program. How do I compile that into my program?

Re: std.int128 not working with -betterC enabled

2023-12-20 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Yes that is to be expected. It is not templated, and hasn't been compiled into your program.

Re: std.int128 not working with -betterC enabled

2023-12-20 Thread Renato via Digitalmars-d-learn
On Wednesday, 20 December 2023 at 18:46:41 UTC, Renato wrote: ``` dmd -L-ld_classic -unittest -checkaction=context -run main.d Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable (maybe you meant: __D4core6thread10threadbase1

Re: std.int128 not working with -betterC enabled

2023-12-20 Thread Renato via Digitalmars-d-learn
On Wednesday, 20 December 2023 at 18:16:00 UTC, Renato wrote: But with -betterC: ``` dmd -L-ld_classic -betterC -run dasc.d Undefined symbols for architecture x86_64: "__D3std6int1286Int1286__ctorMFNaNbNcNiNfllZSQBpQBoQBk", referenced from: _main in dasc.o ld: symbol(s) not found for

std.int128 not working with -betterC enabled

2023-12-20 Thread Renato via Digitalmars-d-learn
I wanted to write a small program using betterC that needs to use int128. This simple program works without -betterC: ```d module dasc; import std.int128; import core.stdc.stdio; extern (C): int main() { auto n = Int128(128, 128); printf("n=%lu%lu", n.data.hi, n.data.lo); return 42; }