On 28 December 2017 at 17:04, john skaller <[email protected]> wrote:
>> On 29 Dec. 2017, at 03:31, Jeremy Yallop <[email protected]> wrote:
>
>>> Hmm. What does it mean when it says “the size and alignment are retrieved”??
>>> The only way to do that would be to generate C code and measure it.
>>
>> Indeed, that's exactly what happens.  The C standard doesn't place
>> many constraints on the layout of enums, so there isn't really another
>> way of building enum types that’s guaranteed to work.
>
> Layout rules in general for C are fully fixed by the ABI.
> That’s platform dependent BUT you only need to figure out
> the ABI once per platform.

Fair enough -- checking the ABI at configuration time could be made to
work, too.  But would there be much benefit?  Wouldn't it still be
necessary to generate C code (or do something similar, like parse
headers and evaluate constant expressions) to retrieve the values of
enumeration constants?
_______________________________________________
Ctypes mailing list
[email protected]
http://lists.ocaml.org/listinfo/ctypes

Reply via email to