Add Lua 5.1 to rockspec#9
Open
javalikescript wants to merge 4 commits into
Open
Conversation
|
Hey, this is almost right but the define should switch at 5.2, not 5.3. Compiling for 5.2 as is it picks the lua 5.1 version and fails: I'd suggest renaming diff --git a/luachild_lua_5_1.c b/luachild_lua_5_1.c
index c4ca9de..bfdea1b 100644
--- a/luachild_lua_5_1.c
+++ b/luachild_lua_5_1.c
@@ -1,6 +1,6 @@
#include "luachild.h"
#ifdef USE_LUAPUC
-#if LUA_VERSION_NUM < 503
+#if LUA_VERSION_NUM < 502
#include <stdio.h>
#include <errno.h>
diff --git a/luachild_lua_5_3.c b/luachild_lua_5_2.c
similarity index 97%
rename from luachild_lua_5_3.c
rename to luachild_lua_5_2.c
index 24ee272..acde7d4 100644
--- a/luachild_lua_5_3.c
+++ b/luachild_lua_5_2.c
@@ -1,6 +1,6 @@
#include "luachild.h"
#ifdef USE_LUAPUC
-#if LUA_VERSION_NUM > 502
+#if LUA_VERSION_NUM >= 502
#include <stdio.h>
#include <errno.h>
diff --git a/luachild-scm-1.rockspec b/luachild-scm-1.rockspec
index 75a7efd..d2ce5a4 100644
--- a/luachild-scm-1.rockspec
+++ b/luachild-scm-1.rockspec
@@ -29,7 +29,7 @@ build = {
["luachild"] = {
defines = { "USE_POSIX" },
incdirs = { "./" },
- sources = { "luachild_common.c", "luachild_lua_5_3.c", "luachild_lua_5_1.c", "luachild_luajit_2_1.c", "luachild_posix.c", "luachild_windows.c", }
+ sources = { "luachild_common.c", "luachild_lua_5_2.c", "luachild_lua_5_1.c", "luachild_luajit_2_1.c", "luachild_posix.c", "luachild_windows.c", }
},
},
},
@@ -39,7 +39,7 @@ build = {
["luachild"] = {
defines = { "USE_WINDOWS" },
incdirs = { "./" },
- sources = { "luachild_common.c", "luachild_lua_5_3.c", "luachild_lua_5_1.c", "luachild_luajit_2_1.c", "luachild_posix.c", "luachild_windows.c", }
+ sources = { "luachild_common.c", "luachild_lua_5_2.c", "luachild_lua_5_1.c", "luachild_luajit_2_1.c", "luachild_posix.c", "luachild_windows.c", }
},
},
},(the With this change applied, it builds all versions from Lua 5.1 to 5.5 for me. |
s-ol
reviewed
May 14, 2026
| #include "luachild.h" | ||
| #ifdef USE_LUAPUC | ||
| #if LUA_VERSION_NUM > 502 | ||
| #if LUA_VERSION_NUM >= 503 |
There was a problem hiding this comment.
@javalikescript this should be >= 502, otherwise Lua 5.2 is left with no implementation at all
There was a problem hiding this comment.
lua 5.2 already works, just compile it as 5.3, there is no difference in the C API used by this library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #8