[m-rev.] for review: bulk unify and compare

Julien Fischer jfischer at opturion.com
Tue Oct 2 14:20:03 AEST 2018



On Tue, 2 Oct 2018, Zoltan Somogyi wrote:

> On Tue, 02 Oct 2018 13:42:24 +1000 (AEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>>>> +#ifdef MR_INT_LEAST64_TYPE
>>>
>>> If your intention was to use that macro to distinguish between 32- and 64-bit
>>> systems, then that won't work.  (MR_INT_LEAST64_TYPE *will* be defined
>>> on 32-bit systems so long as they also provide a 64-bit integer type.)
>>
>> There are very few preprocessor tests for the size of words in the library.
>> There is one in uint32.m, MR_INT_IS_32_BIT. It is not *exactly* what I want,
>> since it not being set does not *guarantee* that int is 64 bit (it could be 16, or
>> 128, or some non-power-of-2), but in practice, it ought to work. Do you agree?
>
> Actually, scratch that. configure.ac already computes MR_BITS_PER_WORD,
> we just do not keep it. I will add an entry to runtime/mercury_conf.h.in
> to keep it, and use that.

Or MR_BYTES_PER_WORD, which I think we do keep.

That said, there's probably a case for adding a new macro

    MR_HEY_I_AM_A_64_BIT_MERCURY

in order to simplify such tests in the future.

Julien.


More information about the reviews mailing list