Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls_sqlite3: conditional use of lua_isinteger #158

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Feb 6, 2024

The lua_isinteger function is only present in Lua 5.3+. To maintain compatibility with earlier Lua versions (notably 5.2 and 5.1) this pull request gates the usage of this function with defined pre-processor checks. In the case where the symbol is not defined, we unconditionally fall back to existing logic that treats the maybe-an-int item in question as if lua_isinteger returned false.

Resolves #147

The `lua_isinteger` function is only present in Lua 5.3. To maintain
compatibility with earlier Lua versions (notably 5.2 and 5.1) this
commit gates the usage of this function with `defined` pre-processor
checks. In the case where the symbol is not defined, we unconditionally
fall back to existing logic that treats the maybe-an-int item in
question as if `lua_isinteger` returned false.
@cpu cpu mentioned this pull request Feb 6, 2024
@tomasguisasola tomasguisasola merged commit 930aeb3 into lunarmodules:master Feb 7, 2024
@cpu cpu deleted the cpu-147-lua5.1-compat-fix branch February 7, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Broken Lua 5.1 compatibility?
2 participants