Skip to content

fix: remove Lua.equal with compile error for lua 5.2, 5.3, 5.4#118

Merged
robbielyman merged 2 commits intonatecraddock:mainfrom
robbielyman:main
Nov 9, 2024
Merged

fix: remove Lua.equal with compile error for lua 5.2, 5.3, 5.4#118
robbielyman merged 2 commits intonatecraddock:mainfrom
robbielyman:main

Conversation

@robbielyman
Copy link
Collaborator

lua_equal is deprecated in Lua versions 5.2 and later; the same behavior can be achieved with lua_compare with the equality flag. this commit makes using lua_equal a compile error when lang is 5.2, 5.3 or 5.4. in fact, it is already a compile error (since the C header does not expose the function), but making it fail faster with a helpful replacement suggestion seems useful.

I chose to leave the declaration of equal untouched: I think this is helpful for ZLS, which I find has a tough time resolving switch (lang) in my seamstress project, but I'm happy to take a different route too.

`lua_equal` is deprecated in Lua versions 5.2 and later; the same
behavior can be achieved with `lua_compare` with the equality
flag. this commit makes using `lua_equal` a compile error when `lang`
is 5.2, 5.3 or 5.4. in fact, it is already a compile error (since the
C header does not expose the function), but making it fail faster with
a helpful replacement suggestion seems useful.
@robbielyman robbielyman mentioned this pull request Nov 3, 2024
@natecraddock
Copy link
Owner

Thanks! Just noticed a tiny duplication in the comments. Sorry for the delay

@robbielyman robbielyman merged commit be1990d into natecraddock:main Nov 9, 2024
robbielyman added a commit to robbielyman/ziglua that referenced this pull request Nov 29, 2024
…ecraddock#118)

* fix: remove `Lua.equal` with compile error for lua 5.2, 5.3, 5.4

`lua_equal` is deprecated in Lua versions 5.2 and later; the same
behavior can be achieved with `lua_compare` with the equality
flag. this commit makes using `lua_equal` a compile error when `lang`
is 5.2, 5.3 or 5.4. in fact, it is already a compile error (since the
C header does not expose the function), but making it fail faster with
a helpful replacement suggestion seems useful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants