flukso / lua-mosquitto

Lua bindings to the libmosquitto MQTT client library.
https://github.com/flukso/lua-mosquitto
Other
63 stars 42 forks source link

add support for Lua 5.2 #2

Closed ncopa closed 9 years ago

ncopa commented 10 years ago

fixes #1

Signed-off-by: Natanael Copa ncopa@alpinelinux.org

icarus75 commented 10 years ago

Thanks for the pull request. This does not fully solve the issue since the makefile still references Lua 5.1: LUAPATH = /usr/local/share/lua/5.1 LUACPATH = /usr/local/lib/lua/5.1 INCDIR = -I/usr/include/lua5.1

We should be able to reference the proper Lua version in the makefile and simply add the -DLUA_COMPAT_ALL to the CFLAGS (by default or when targeting 5.2 only). I prefer to keep references to Lua versions out of the code itself.

ncopa commented 10 years ago

The patch only adds support for Lua 5.2 but still defaults to Lua 5.1. You can select which Lua version you build against by setting the compiler flags via INCDIR.

Also I think the -DLUA_COMPAT_ALL only works when Lua it self is compiled with compat enabled. The patch should make i work with Lua 5.2 without compat and Lua 5.3 with compat enabled, which will be released soonish.

Once Lua 5.3 is out you can expect that support for Lua 5.1 will be dropped from distros. (Lua 5.2 was released 2 years ago)

would you prefer that we have a separate compat.h header so we can remove the ifdefs in the .c file?

rnalrd commented 10 years ago

I'd like see support for Lua 5.2. Any hope to get it soon? Thanks!

karlp commented 10 years ago

Lua 5.2 support should be a little easier with the pkg-config pull to the makefile I've just submitted in https://github.com/flukso/lua-mosquitto/pull/4

ncopa commented 9 years ago

Lua 5.2 support was added