diff options
| -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 |
