rrthomas / lrexlib

A Lua (5.1 and later) binding of various regex library APIs (POSIX, PCRE, PCRE2, GNU, Oniguruma and TRE)
Other
161 stars 29 forks source link

make lrexlib compatible with Lua5.3 #23

Closed starwing closed 4 years ago

shmuz commented 8 years ago

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 in CFLAGS.

starwing commented 8 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.

RealyUniqueName commented 6 years ago

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

https://travis-ci.org/haxe-utest/utest/jobs/312804603#L1605

shmuz commented 6 years ago

Is this the reason for the following error?

If LUA_COMPAT_5_2 is not defined then yes.

JZerf commented 4 years ago

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.