lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




2009/12/14 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
> That's one *big* reminder I want to put out for the Lua authors:
> whatever you supply as the out-of-the-box configuration *will* be
> used by distributions. And it will stick, since they require a
> stable ABI. So better plan ahead and work with the maintainers.

Any concrete suggestions about luaconf.h etc, Mike?

A unix/linux platform can be detected at compile time, then it can also detect if the model is LLP64 or the rarer ILP64 using the defines in unistd.h XBS5_LP64_OFF64 and _XBS5_LPBIG_OFFBIG. On windows the LLP64 model will not cause problems for int or long, for other platforms I do not know

Instead of the above a typedef would also be an option, for example (substituting LUA_INTEGER for int or long maybe)
typedef char If_you_want_to_use_big_and_small_numbers_you_need_to_change_XYZ_in_luaconfig_and_comment_this_out[ sizeof(int) >= sizeof(double) ? -1 : 1];

similarly sizeof(long) >= sizeof(double)

Lastly there could be a unit test to check this that is run when make test is run. I was astonished that this test only wrote to stdout when I looked the other day. What does this actually tell a user about the configuration used?

Liam