diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-08-29 18:50:38 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-08-29 19:08:00 -0300 |
commit | 627d3bb2782841e15c3c47f0914dae9b8decb5aa (patch) | |
tree | 009c2daf52cc7a02d3684e843ef1225e21edd549 | |
parent | 0c9acd4acf59e45ceccb4b242a2c6c330149c5f5 (diff) | |
download | lua-compat-5.3-627d3bb2782841e15c3c47f0914dae9b8decb5aa.tar.gz lua-compat-5.3-627d3bb2782841e15c3c47f0914dae9b8decb5aa.tar.bz2 lua-compat-5.3-627d3bb2782841e15c3c47f0914dae9b8decb5aa.zip |
avoid MSVC build error
```
Microsoft (R) Incremental Linker Version 14.00.24241.7
Copyright (C) Microsoft Corporation. All rights reserved.
io.def : error LNK2001: unresolved external symbol luaopen_compat53_io
compat53/io.lib : fatal error LNK1120: 1 unresolved externals
Error: Build error: Failed compiling module compat53/io.dll
```
-rw-r--r-- | lprefix.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -195,6 +195,9 @@ LUAMOD_API int luaopen_compat53_string (lua_State *L) { | |||
195 | # endif | 195 | # endif |
196 | 196 | ||
197 | /* choose which popen implementation to pick */ | 197 | /* choose which popen implementation to pick */ |
198 | # if defined(_MSC_VER) | ||
199 | # define LUA_USE_WINDOWS 1 | ||
200 | # endif | ||
198 | # if (!defined(LUA_USE_WINDOWS) && !defined(LUA_USE_POSIX)) && \ | 201 | # if (!defined(LUA_USE_WINDOWS) && !defined(LUA_USE_POSIX)) && \ |
199 | ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \ | 202 | ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \ |
200 | (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || \ | 203 | (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || \ |
@@ -242,13 +245,17 @@ static void createmeta (lua_State *L); | |||
242 | # undef LUA_FILEHANDLE | 245 | # undef LUA_FILEHANDLE |
243 | # define LUA_FILEHANDLE COMPAT53_LUA_PFILEHANDLE | 246 | # define LUA_FILEHANDLE COMPAT53_LUA_PFILEHANDLE |
244 | 247 | ||
248 | LUAMOD_API int luaopen_compat53_io (lua_State *L) { | ||
249 | luaL_Reg const funcs[] = { | ||
250 | |||
245 | /* for PUC-Rio Lua 5.1 only */ | 251 | /* for PUC-Rio Lua 5.1 only */ |
246 | # if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM == 501 && !defined(LUA_JITLIBNAME) | 252 | # if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM == 501 && !defined(LUA_JITLIBNAME) |
247 | 253 | ||
248 | LUAMOD_API int luaopen_compat53_io (lua_State *L) { | ||
249 | luaL_Reg const funcs[] = { | ||
250 | { "popen", io_popen }, | 254 | { "popen", io_popen }, |
251 | { "type", io_ptype }, | 255 | { "type", io_ptype }, |
256 | |||
257 | # endif /* for PUC-Rio Lua 5.1 only */ | ||
258 | |||
252 | { NULL, NULL } | 259 | { NULL, NULL } |
253 | }; | 260 | }; |
254 | luaL_newlib(L, funcs); | 261 | luaL_newlib(L, funcs); |
@@ -256,7 +263,6 @@ LUAMOD_API int luaopen_compat53_io (lua_State *L) { | |||
256 | return 1; | 263 | return 1; |
257 | } | 264 | } |
258 | 265 | ||
259 | # endif /* for PUC-Rio Lua 5.1 only */ | ||
260 | 266 | ||
261 | /* fake CLANG feature detection on other compilers */ | 267 | /* fake CLANG feature detection on other compilers */ |
262 | # ifndef __has_attribute | 268 | # ifndef __has_attribute |