diff --git a/lprefix.h b/lprefix.h index f401c9c..8ad5a4d 100644 --- a/lprefix.h +++ b/lprefix.h @@ -195,6 +195,9 @@ LUAMOD_API int luaopen_compat53_string (lua_State *L) { # endif /* choose which popen implementation to pick */ +# if defined(_MSC_VER) +# define LUA_USE_WINDOWS 1 +# endif # if (!defined(LUA_USE_WINDOWS) && !defined(LUA_USE_POSIX)) && \ ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \ (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || \ @@ -242,13 +245,17 @@ static void createmeta (lua_State *L); # undef LUA_FILEHANDLE # define LUA_FILEHANDLE COMPAT53_LUA_PFILEHANDLE +LUAMOD_API int luaopen_compat53_io (lua_State *L) { + luaL_Reg const funcs[] = { + /* for PUC-Rio Lua 5.1 only */ # if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM == 501 && !defined(LUA_JITLIBNAME) -LUAMOD_API int luaopen_compat53_io (lua_State *L) { - luaL_Reg const funcs[] = { { "popen", io_popen }, { "type", io_ptype }, + +# endif /* for PUC-Rio Lua 5.1 only */ + { NULL, NULL } }; luaL_newlib(L, funcs); @@ -256,7 +263,6 @@ LUAMOD_API int luaopen_compat53_io (lua_State *L) { return 1; } -# endif /* for PUC-Rio Lua 5.1 only */ /* fake CLANG feature detection on other compilers */ # ifndef __has_attribute