Closed lmoureaux closed 1 year ago
Is there an update on this?
I don't think this is a valid PR. I absolutely want to check if the value is defined to 0, and not act on it if it's defined to be 0. 0 means "off", not-0 means "on".
You’re misunderstanding how Lua uses feature macros. As detailed in #1461, Lua does not define these macros to 0 or 1 to disable or enable the feature. The feature is enabled whenever the macro is defined at all, and src/luaconf.h defines LUA_COMPAT_BITLIB
as an empty macro.
I'm in a bit of a bind, then, because some folk are using custom confs to explicitly shut it off by redefining it to be 0.... well.
Maybe this just means those folks will have to switch to agressive #undef
. Hell if I know what's the right way anymore.
Either way, this is back to a way that'll work for everyone in this PR by way of this: https://github.com/ThePhD/sol2/commit/839f2a1dceb0c274d54ba755b2b508df3b7fdca5
Hi and thank you for sol2!
Lua may define the macros but leaves them empty. The code assumed they would contain a boolean value.
This is required to use sol2 with system Lua on Fedora 37 (see https://github.com/longturn/freeciv21/issues/1895)
Closes #1461.