Foreign interface: way to get uint64_t

Is there a way to get the full range of uint64_t from Prolog to C?

We have PL_unify_uint64(...) to go from C to Prolog, but there is no PL_get_uint64(...). There is PL_get_intptr(...) but it fails with a representation error if I put 0xffffffff_ffffffff in the Prolog term (The same kind of error with PL_get_int64(...)).

Cannot represent due to `long'

Thanks!

On 64 bit systems there is PL_get_size_ex(). There is currently no solution for 32-bit machines.

Thanks!

Sad, eventually I was planning to write the assembler for arm also.

I didn’t say it cannot be implemented. Note that 64 bit unsigned integers with the high bit set are internally GMP numbers, so you need unbounded integer support. Feel free to walk through the conversion routines, add the missing ones and send a pull request.

Thanks, when the time comes up for arm I’ll take a look at it; right now I am focusing on x64 but thinking about portability early.

Things are moving forward nicely.