brimworks / lua-yajl

Integrate the yajl JSON library with Lua.
Other
48 stars 10 forks source link

Incompatible with Lua 5.2.0 #10

Closed ghost closed 2 weeks ago

ghost commented 9 years ago

When compiling against Lua 5.2.0, getfenv, setfenv, and objlen are missing. Lua 5.2 uses lexical scopes instead of dynamic ones. objlen could be changed to rawlen, but since I haven't looked closely at what you are manipulating the environment for I don't have a patch. I may offer one up shortly.

brimworks commented 9 years ago

Patches are always welcomed :).

Thanks, -Brian

hp77-creator commented 3 weeks ago

Hi @brimworks how can one ensure that it will compile for both versions i.e 5.1 & > 5.1 I am new to Lua, how is it handled in Lua ecosystem? any suggestions, I am open to sending the patch

brimworks commented 3 weeks ago

Unfortunately, some of the API breaking changes require rethinking how this library works when porting to 5.2.

Like this one:

This change looks like it would be easy to work around with a preprocessor compiler directive though:

brimworks commented 3 weeks ago

Actually, the fix was easier than expected. @hp77-creator do you mind checking out my branch and verifying it works for you? Here is the PR:

https://github.com/brimworks/lua-yajl/pull/18

brimworks commented 2 weeks ago

PR was merged, so this should be fixed. I'll plan to do a lua rocks release soon.

hp77-creator commented 2 weeks ago

Hi @brimworks thanks for swift response, I was afk for sometime due to vacation, will check. Thanks a lot.