[PATCH] lua: work around 32-bit integers limitation in vlc.var

Pierre Ynard linkfanel at yahoo.fr
Mon Nov 28 05:22:56 CET 2016

> See next comment regarding preprocessor evaluation rather than runtime
> checks.

> The above, and what follows, makes more sense as a preprocessor
> condition, given that `sizeof` will not change during runtime (and I
> fear unwanted compiler diagnostics related to "always true" vs "always
> false").

It is not quite a runtime check: it is optimized away at compile time. I
would still prefer to do it in preprocessor, yes; but I don't know how
to. I don't know how to access sizeof(val.i_int) from the preprocessor,
and I don't know how to test sizeof(lua_Integer). I suppose it would be
possible to add autoconf macros testing lua types, but that seems very
heavy to me. Better ideas are welcome.

> `roundf` is in `<math.h>` starting with `C99`.

Okay, yes.

Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."

More information about the vlc-devel mailing list