[m-rev.] for review: clarify how foreign_enum values are specified in C

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Sep 25 15:38:38 AEST 2021


2021-09-25 15:33 GMT+10:00 "Julien Fischer" <jfischer at opturion.com>:
> @@ -9551,8 +9551,13 @@ as the use of @samp{pragma foreign_type} results in more type-safe code.
>  @subsubsection Using pragma foreign_enum for C
> 
>  Foreign enumeration values in C must be constants of type @code{MR_Integer}.
> -They may be specified as either integer literals
> -or via preprocessor macros that expand to integer literals.
> +A foreign enumeration value may be specified by one of the following:
> + at itemize
> + at item An integer literal.
> + at item An enumeration constant.
> + at item A preprocessor macro that expands to either an integer literal or
> +an enumeration constant.
> + at end itemize
> 
>  @node Using pragma foreign_export_enum for C
>  @subsubsection Using pragma foreign_export_enum for C

That is fine as far as it goes. But if this is in response to the m-users emails
from Sean Charles today, then I think what would help more is a statement
about the C type that programmers should use for a type defined
by a pragma foreign enum. Section 14.6 of the reference manual
does not seem to have one.

Zoltan.


More information about the reviews mailing list