Closed starwing closed 4 years ago
but LUA_COMPAT_5_2 define many things other than this, or i could real replace (check/opt)int to proper integer version to avoid warnings, just a little extra work.
i do this because luvi project use this module, and i'm working on compatible works for that. and other modules it used use these macro to keep compatible.
Is this the reason for the following error?
lua: error loading module 'rex_pcre' from file '/usr/local/lib/lua/5.3/rex_pcre.so':
dlopen(/usr/local/lib/lua/5.3/rex_pcre.so, 6): Symbol not found: _luaL_optint
Referenced from: /usr/local/lib/lua/5.3/rex_pcre.so
Expected in: flat namespace
in /usr/local/lib/lua/5.3/rex_pcre.so
Is this the reason for the following error?
If LUA_COMPAT_5_2
is not defined then yes.
FYI, this pull request shouldn't be needed anymore since https://github.com/rrthomas/lrexlib/commit/6b517b141c16a9366a2b2e70b5493aebc43beb45 was committed a couple weeks ago. That commit replaced the luaL_optint() calls with calls to luaL_optinteger() like @starwing suggested in https://github.com/rrthomas/lrexlib/pull/23#issuecomment-186881655. Those changes make Lrexlib compatible with Lua 5.3 and 5.4 without having to use the LUA_COMPAT_5_2 define.
I'm not sure if this change is needed since there is a define of
LUA_COMPAT_5_2
in the rockspecs.lua. With that define in place it should compile fine for Lua 5.3. If LuaRocks is not used one can include-DLUA_COMPAT_5_2
inCFLAGS
.