-
Notifications
You must be signed in to change notification settings - Fork 38
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
Compiling on windows (through luarocks) fails, it thinks my system is POSIX #63
Comments
This is odd because it should be getting those defines from your You can save this file as package = "compat53"
version = "0.12-1"
source = {
url = "https://github.com/lunarmodules/lua-compat-5.3/archive/v0.12.zip",
dir = "lua-compat-5.3-0.12",
}
description = {
summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1",
detailed = [[
This is a small module that aims to make it easier to write Lua
code in a Lua-5.3-style that runs on Lua 5.1+.
It does *not* make Lua 5.2 (or even 5.1) entirely compatible
with Lua 5.3, but it brings the API closer to that of Lua 5.3.
]],
homepage = "https://github.com/lunarmodules/lua-compat-5.3",
license = "MIT"
}
dependencies = {
"lua >= 5.1, < 5.5",
--"struct" -- make Roberto's struct module optional
}
build = {
type = "builtin",
modules = {
["compat53.init"] = "compat53/init.lua",
["compat53.module"] = "compat53/module.lua",
["compat53.utf8"] = "lutf8lib.c",
["compat53.table"] = "ltablib.c",
["compat53.string"] = "lstrlib.c",
["compat53.io"] = {
sources = { "liolib.c" },
}
},
platforms = {
windows = {
modules = {
["compat53.io"] = {
defines = { "LUA_USE_WINDOWS" },
}
}
}
}
}
|
Unfortunately I don't have a Windows system to test this on, so any help debugging this is much appreciated! |
I'll try this too, I am using the latest (like latest commit) of luarocks because it seems to be the only one that works well on windows |
That is encouraging to hear :) I am planning to cut a new LuaRocks release by the end of the week. |
Just got a chance to test it (had to create a new windows VM) same error, but I realise its using my "C:\Program Files\LLVM\bin\gcc.exe" -O2 -c -o liolib.o -IC:\Program Files\Lua\5.4\include liolib.c -DLUA_USE_WINDOWS
In file included from liolib.c:10:
In file included from ./lprefix.h:46:
In file included from ./c-api/compat-5.3.h:10:
In file included from C:\Program Files\Lua\5.4\include/lua.h:16:
C:\Program Files\Lua\5.4\include/luaconf.h:51:9: warning: 'LUA_USE_WINDOWS' macro redefined [-Wmacro-redefined]
51 | #define LUA_USE_WINDOWS /* enable goodies for regular Windows */
| ^
<command line>:1:9: note: previous definition is here
1 | #define LUA_USE_WINDOWS 1
| ^
liolib.c:408:13: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
408 | rn->c = l_getc(rn->f); /* read next one */
| ^ |
Yes, Lua installations include
Ok, so that means that the Lua headers do attempt to set The reason why I wanted to try that rockspec is because this error...
...is happening due to that line 86: Line 86 in b182b41
...which is inside a Perhaps there's some difference in configuration between the system in your original message and the Windows VM where you tried this rockspec? Does the original rockspec fail the same way as the original message in the Windows VM? I don't see a way how Thank you for the testing! Let's keep digging this! |
Oh wait, looks like compat-5.3 really is doing something wrong here: Lines 197 to 204 in 737264a
I made this PR to try to fix the issue: #64 Could you test it? You should be able to do that by fetching that branch and then running |
Will do! Give me a moment |
Fixed in #64 |
Compat-5.3 0.13 is released!! |
The text was updated successfully, but these errors were encountered: