From 925ff1da3c33eebbd7cc83fd8ab1bfb30eb08e1b Mon Sep 17 00:00:00 2001 From: jacob1 Date: Fri, 22 Aug 2014 01:25:34 -0400 Subject: [PATCH] add lua5.2 support for no particular reason --- SConscript | 12 ++++++++---- src/lua/LuaBit.cpp | 10 +++++----- src/lua/LuaCompat.c | 11 +++++++++++ src/lua/{luainc.h => LuaCompat.h} | 7 +++++++ src/lua/LuaLuna.h | 2 +- src/lua/LuaScriptInterface.cpp | 14 +++++++------- src/lua/LuaScriptInterface.h | 2 +- src/lua/socket/auxiliar.c | 2 +- src/lua/socket/auxiliar.h | 4 ++-- src/lua/socket/buffer.c | 2 +- src/lua/socket/buffer.h | 2 +- src/lua/socket/except.c | 2 +- src/lua/socket/except.h | 2 +- src/lua/socket/inet.c | 2 +- src/lua/socket/inet.h | 2 +- src/lua/socket/io.h | 2 +- src/lua/socket/luasocket.c | 4 ++-- src/lua/socket/luasocket.h | 2 +- src/lua/socket/options.h | 2 +- src/lua/socket/select.c | 2 +- src/lua/socket/socket.lua.cpp | 2 +- src/lua/socket/socket.lua.h | 2 +- src/lua/socket/tcp.c | 4 ++-- src/lua/socket/tcp.h | 2 +- src/lua/socket/timeout.c | 2 +- src/lua/socket/timeout.h | 2 +- src/lua/socket/udp.c | 4 ++-- src/lua/socket/udp.h | 2 +- src/lua/socket/unix.c | 4 ++-- src/lua/socket/unix.h | 2 +- 30 files changed, 68 insertions(+), 46 deletions(-) create mode 100644 src/lua/LuaCompat.c rename src/lua/{luainc.h => LuaCompat.h} (58%) diff --git a/SConscript b/SConscript index cbf4a0ddbb..fd08935c2b 100644 --- a/SConscript +++ b/SConscript @@ -248,13 +248,17 @@ def findLibs(env, conf): if not GetOption('nolua') and not GetOption('renderer'): #Look for Lua + luaver = "lua5.1" if not conf.CheckLib(['lua5.1', 'lua-5.1', 'lua51', 'lua']): - if platform != "Darwin" or not conf.CheckFramework("Lua"): + if conf.CheckLib(['lua5.2', 'lua-5.2', 'lua52']): + env.Append(CPPDEFINES=["LUA_COMPAT_ALL"]) + luaver = "lua5.2" + elif platform != "Darwin" or not conf.CheckFramework("Lua"): FatalError("lua5.1 development library not found or not installed") if platform == "Linux": try: - env.ParseConfig('pkg-config --cflags lua5.1') - env.ParseConfig('pkg-config --libs lua5.1') + env.ParseConfig("pkg-config --cflags {0}".format(luaver)) + env.ParseConfig("pkg-config --libs {0}".format(luaver)) except: pass @@ -479,7 +483,7 @@ if GetOption('beta'): #Generate list of sources to compile sources = Glob("src/*.cpp") + Glob("src/*/*.cpp") + Glob("src/*/*/*.cpp") + Glob("generated/*.cpp") if not GetOption('nolua') and not GetOption('renderer'): - sources += Glob("src/lua/socket/*.c") + sources += Glob("src/lua/socket/*.c") + Glob("src/lua/LuaCompat.c") if platform == "Windows" and not msvc: sources += env.RES('resources/powder-res.rc') diff --git a/src/lua/LuaBit.cpp b/src/lua/LuaBit.cpp index d03db4132c..96fa008228 100644 --- a/src/lua/LuaBit.cpp +++ b/src/lua/LuaBit.cpp @@ -29,7 +29,7 @@ #define LUA_BITOP_VERSION "1.0.2" -#include "luainc.h" +#include "LuaCompat.h" #ifdef _MSC_VER /* MSVC is stuck in the last century and doesn't have C99's stdint.h. */ @@ -178,11 +178,11 @@ int luaopen_bit(lua_State *L) msg = "arithmetic right-shift broken"; luaL_error(L, "bit library self-test failed (%s)", msg); } -#if LUA_VERSION_NUM < 502 +//#if LUA_VERSION_NUM < 502 luaL_register(L, "bit", bit_funcs); -#else - luaL_newlib(L, bit_funcs); -#endif +//#else +// luaL_newlib(L, bit_funcs); +//#endif return 1; } #endif diff --git a/src/lua/LuaCompat.c b/src/lua/LuaCompat.c new file mode 100644 index 0000000000..0ecec27142 --- /dev/null +++ b/src/lua/LuaCompat.c @@ -0,0 +1,11 @@ +#include "LuaCompat.h" + +#if LUA_VERSION_NUM >= 502 +//implement missing luaL_typerror function +int luaL_typerror (lua_State *L, int narg, const char *tname) +{ + const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg)); + return luaL_argerror(L, narg, msg); +} + +#endif diff --git a/src/lua/luainc.h b/src/lua/LuaCompat.h similarity index 58% rename from src/lua/luainc.h rename to src/lua/LuaCompat.h index 11940890c0..f7e843d9a2 100644 --- a/src/lua/luainc.h +++ b/src/lua/LuaCompat.h @@ -16,6 +16,13 @@ extern "C" #include "lualib.h" #endif +#if LUA_VERSION_NUM >= 502 +#define luaL_getn(L,i) lua_rawlen(L, (i)) +#define LUA_GLOBALSINDEX LUA_RIDX_GLOBALS + +LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); +#endif + #ifdef __cplusplus } #endif diff --git a/src/lua/LuaLuna.h b/src/lua/LuaLuna.h index 784efa2a35..c5caa1877a 100644 --- a/src/lua/LuaLuna.h +++ b/src/lua/LuaLuna.h @@ -1,7 +1,7 @@ #pragma once //http://lua-users.org/wiki/SimplerCppBinding -#include "luainc.h" +#include "LuaCompat.h" template class Luna { diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 281d54dd56..bf54e65e74 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -139,7 +139,7 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m): int i = 0, j; char tmpname[12]; int currentElementMeta, currentElement; - const static struct luaL_reg tptluaapi [] = { + const static struct luaL_Reg tptluaapi [] = { {"test", &luatpt_test}, {"drawtext", &luatpt_drawtext}, {"create", &luatpt_create}, @@ -442,7 +442,7 @@ int LuaScriptInterface::tpt_newIndex(lua_State *l) void LuaScriptInterface::initInterfaceAPI() { - struct luaL_reg interfaceAPIMethods [] = { + struct luaL_Reg interfaceAPIMethods [] = { {"showWindow", interface_showWindow}, {"closeWindow", interface_closeWindow}, {"addComponent", interface_addComponent}, @@ -535,7 +535,7 @@ int LuaScriptInterface::particlePropertiesCount; void LuaScriptInterface::initSimulationAPI() { //Methods - struct luaL_reg simulationAPIMethods [] = { + struct luaL_Reg simulationAPIMethods [] = { {"partNeighbours", simulation_partNeighbours}, {"partNeighbors", simulation_partNeighbours}, {"partChangeType", simulation_partChangeType}, @@ -1765,7 +1765,7 @@ int LuaScriptInterface::simulation_neighbours(lua_State * l) void LuaScriptInterface::initRendererAPI() { //Methods - struct luaL_reg rendererAPIMethods [] = { + struct luaL_Reg rendererAPIMethods [] = { {"renderModes", renderer_renderModes}, {"displayModes", renderer_displayModes}, {"colourMode", renderer_colourMode}, @@ -1957,7 +1957,7 @@ int LuaScriptInterface::renderer_debugHUD(lua_State * l) void LuaScriptInterface::initElementsAPI() { //Methods - struct luaL_reg elementsAPIMethods [] = { + struct luaL_Reg elementsAPIMethods [] = { {"allocate", elements_allocate}, {"element", elements_element}, {"property", elements_property}, @@ -2474,7 +2474,7 @@ int LuaScriptInterface::elements_free(lua_State * l) void LuaScriptInterface::initGraphicsAPI() { //Methods - struct luaL_reg graphicsAPIMethods [] = { + struct luaL_Reg graphicsAPIMethods [] = { {"textSize", graphics_textSize}, {"drawText", graphics_drawText}, {"drawLine", graphics_drawLine}, @@ -2683,7 +2683,7 @@ int LuaScriptInterface::graphics_getHexColor(lua_State * l) void LuaScriptInterface::initFileSystemAPI() { //Methods - struct luaL_reg fileSystemAPIMethods [] = { + struct luaL_Reg fileSystemAPIMethods [] = { {"list", fileSystem_list}, {"exists", fileSystem_exists}, {"isFile", fileSystem_isFile}, diff --git a/src/lua/LuaScriptInterface.h b/src/lua/LuaScriptInterface.h index e4f7cb1b20..65e7709172 100644 --- a/src/lua/LuaScriptInterface.h +++ b/src/lua/LuaScriptInterface.h @@ -1,7 +1,7 @@ #ifndef LUASCRIPTINTERFACE_H_ #define LUASCRIPTINTERFACE_H_ -#include "luainc.h" +#include "LuaCompat.h" #include "CommandInterface.h" #include "simulation/Simulation.h" diff --git a/src/lua/socket/auxiliar.c b/src/lua/socket/auxiliar.c index 9514970119..cb00e7b436 100644 --- a/src/lua/socket/auxiliar.c +++ b/src/lua/socket/auxiliar.c @@ -24,7 +24,7 @@ int auxiliar_open(lua_State *L) { * Creates a new class with given methods * Methods whose names start with __ are passed directly to the metatable. \*-------------------------------------------------------------------------*/ -void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func) { +void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func) { luaL_newmetatable(L, classname); /* mt */ /* create __index table to place methods */ lua_pushstring(L, "__index"); /* mt,"__index" */ diff --git a/src/lua/socket/auxiliar.h b/src/lua/socket/auxiliar.h index 9a6cceb743..be704142b5 100644 --- a/src/lua/socket/auxiliar.h +++ b/src/lua/socket/auxiliar.h @@ -31,10 +31,10 @@ * RCS ID: $Id: auxiliar.h,v 1.9 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" int auxiliar_open(lua_State *L); -void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func); +void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func); void auxiliar_add2group(lua_State *L, const char *classname, const char *group); void auxiliar_setclass(lua_State *L, const char *classname, int objidx); void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx); diff --git a/src/lua/socket/buffer.c b/src/lua/socket/buffer.c index 44765e6d79..11a9e5f0ee 100644 --- a/src/lua/socket/buffer.c +++ b/src/lua/socket/buffer.c @@ -222,7 +222,7 @@ static int recvline(p_buffer buf, luaL_Buffer *b) { pos = 0; while (pos < count && data[pos] != '\n') { /* we ignore all \r's */ - if (data[pos] != '\r') luaL_putchar(b, data[pos]); + if (data[pos] != '\r') luaL_addchar(b, data[pos]); pos++; } if (pos < count) { /* found '\n' */ diff --git a/src/lua/socket/buffer.h b/src/lua/socket/buffer.h index d7591c8d12..3cbba6b20c 100644 --- a/src/lua/socket/buffer.h +++ b/src/lua/socket/buffer.h @@ -17,7 +17,7 @@ * * RCS ID: $Id: buffer.h,v 1.12 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" #include "io.h" #include "timeout.h" diff --git a/src/lua/socket/except.c b/src/lua/socket/except.c index 47b78b4d2d..74ec666e9a 100644 --- a/src/lua/socket/except.c +++ b/src/lua/socket/except.c @@ -18,7 +18,7 @@ static int finalize(lua_State *L); static int do_nothing(lua_State *L); /* except functions */ -static luaL_reg func[] = { +static luaL_Reg func[] = { {"newtry", global_newtry}, {"protect", global_protect}, {NULL, NULL} diff --git a/src/lua/socket/except.h b/src/lua/socket/except.h index 044a121577..5d5a182939 100644 --- a/src/lua/socket/except.h +++ b/src/lua/socket/except.h @@ -28,7 +28,7 @@ * RCS ID: $Id: except.h,v 1.2 2005/09/29 06:11:41 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" int except_open(lua_State *L); diff --git a/src/lua/socket/inet.c b/src/lua/socket/inet.c index 52544b1a9d..4506cefbbe 100644 --- a/src/lua/socket/inet.c +++ b/src/lua/socket/inet.c @@ -18,7 +18,7 @@ static void inet_pushresolved(lua_State *L, struct hostent *hp); static int inet_global_gethostname(lua_State *L); /* DNS functions */ -static luaL_reg func[] = { +static luaL_Reg func[] = { { "toip", inet_global_toip }, { "tohostname", inet_global_tohostname }, { "gethostname", inet_global_gethostname}, diff --git a/src/lua/socket/inet.h b/src/lua/socket/inet.h index 68c30ef1c7..b1a081cc78 100644 --- a/src/lua/socket/inet.h +++ b/src/lua/socket/inet.h @@ -16,7 +16,7 @@ * * RCS ID: $Id: inet.h,v 1.16 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" #include "socket.h" #include "timeout.h" diff --git a/src/lua/socket/io.h b/src/lua/socket/io.h index 2d5b9ef3da..810a3b977f 100644 --- a/src/lua/socket/io.h +++ b/src/lua/socket/io.h @@ -15,7 +15,7 @@ * RCS ID: $Id: io.h,v 1.11 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ #include -#include "../luainc.h" +#include "../LuaCompat.h" #include "timeout.h" diff --git a/src/lua/socket/luasocket.c b/src/lua/socket/luasocket.c index d3847b218f..e44e37bfe7 100644 --- a/src/lua/socket/luasocket.c +++ b/src/lua/socket/luasocket.c @@ -37,7 +37,7 @@ static int base_open(lua_State *L); /*-------------------------------------------------------------------------*\ * Modules and functions \*-------------------------------------------------------------------------*/ -static const luaL_reg mod[] = { +static const luaL_Reg mod[] = { {"auxiliar", auxiliar_open}, {"except", except_open}, {"timeout", timeout_open}, @@ -49,7 +49,7 @@ static const luaL_reg mod[] = { {NULL, NULL} }; -static luaL_reg func[] = { +static luaL_Reg func[] = { {"skip", global_skip}, {"__unload", global_unload}, {NULL, NULL} diff --git a/src/lua/socket/luasocket.h b/src/lua/socket/luasocket.h index 22896085b9..4b22bfe30c 100644 --- a/src/lua/socket/luasocket.h +++ b/src/lua/socket/luasocket.h @@ -8,7 +8,7 @@ * * RCS ID: $Id: luasocket.h,v 1.25 2007/06/11 23:44:54 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" /*-------------------------------------------------------------------------*\ * Current socket library version diff --git a/src/lua/socket/options.h b/src/lua/socket/options.h index 5a6ba4663f..ac65047a46 100644 --- a/src/lua/socket/options.h +++ b/src/lua/socket/options.h @@ -10,7 +10,7 @@ * RCS ID: $Id: options.h,v 1.4 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" #include "socket.h" /* option registry */ diff --git a/src/lua/socket/select.c b/src/lua/socket/select.c index d2d3cf88ba..9c295dd90b 100644 --- a/src/lua/socket/select.c +++ b/src/lua/socket/select.c @@ -24,7 +24,7 @@ static void make_assoc(lua_State *L, int tab); static int global_select(lua_State *L); /* functions in library namespace */ -static luaL_reg func[] = { +static luaL_Reg func[] = { {"select", global_select}, {NULL, NULL} }; diff --git a/src/lua/socket/socket.lua.cpp b/src/lua/socket/socket.lua.cpp index 2ccebb1050..ca5e61b1d6 100644 --- a/src/lua/socket/socket.lua.cpp +++ b/src/lua/socket/socket.lua.cpp @@ -1,6 +1,6 @@ #ifdef LUACONSOLE // socket.lua from luasocket compiled into a cpp file -#include "../luainc.h" +#include "../LuaCompat.h" void luaopen_socket(lua_State *l){ int socket_luac_sz=4061; const char* socket_luac="-----------------------------------------------------------------------------\012-- LuaSocket helper module\012-- Author: Diego Nehab\012-- RCS ID: $Id: socket.lua,v 1.22 2005/11/22 08:33:29 diego Exp $\012-----------------------------------------------------------------------------\012\012-----------------------------------------------------------------------------\012-- Declare module and import dependencies\012-----------------------------------------------------------------------------\012local base = _G\012local string = require(\042string\042)\012local math = require(\042math\042)\012local socket = require(\042socket.core\042)\012module(\042socket\042)\012\012-----------------------------------------------------------------------------\012-- Exported auxiliar functions\012-----------------------------------------------------------------------------\012function connect(address, port, laddress, lport)\012 local sock, err = socket.tcp()\012 if not sock then return nil, err end\012 if laddress then\012 local res, err = sock:bind(laddress, lport, -1)\012 if not res then return nil, err end\012 end\012 local res, err = sock:connect(address, port)\012 if not res then return nil, err end\012 return sock\012end\012\012function bind(host, port, backlog)\012 local sock, err = socket.tcp()\012 if not sock then return nil, err end\012 sock:setoption(\042reuseaddr\042, true)\012 local res, err = sock:bind(host, port)\012 if not res then return nil, err end\012 res, err = sock:listen(backlog)\012 if not res then return nil, err end\012 return sock\012end\012\012try = newtry()\012\012function choose(table)\012 return function(name, opt1, opt2)\012 if base.type(name) ~= \042string\042 then\012 name, opt1, opt2 = \042default\042, name, opt1\012 end\012 local f = table[name or \042nil\042]\012 if not f then base.error(\042unknown key (\042.. base.tostring(name) ..\042)\042, 3)\012 else return f(opt1, opt2) end\012 end\012end\012\012-----------------------------------------------------------------------------\012-- Socket sources and sinks, conforming to LTN12\012-----------------------------------------------------------------------------\012-- create namespaces inside LuaSocket namespace\012sourcet = {}\012sinkt = {}\012\012BLOCKSIZE = 2048\012\012sinkt[\042close-when-done\042] = function(sock)\012 return base.setmetatable({\012 getfd = function() return sock:getfd() end,\012 dirty = function() return sock:dirty() end\012 }, {\012 __call = function(self, chunk, err)\012 if not chunk then\012 sock:close()\012 return 1\012 else return sock:send(chunk) end\012 end\012 })\012end\012\012sinkt[\042keep-open\042] = function(sock)\012 return base.setmetatable({\012 getfd = function() return sock:getfd() end,\012 dirty = function() return sock:dirty() end\012 }, {\012 __call = function(self, chunk, err)\012 if chunk then return sock:send(chunk)\012 else return 1 end\012 end\012 })\012end\012\012sinkt[\042default\042] = sinkt[\042keep-open\042]\012\012sink = choose(sinkt)\012\012sourcet[\042by-length\042] = function(sock, length)\012 return base.setmetatable({\012 getfd = function() return sock:getfd() end,\012 dirty = function() return sock:dirty() end\012 }, {\012 __call = function()\012 if length <= 0 then return nil end\012 local size = math.min(socket.BLOCKSIZE, length)\012 local chunk, err = sock:receive(size)\012 if err then return nil, err end\012 length = length - string.len(chunk)\012 return chunk\012 end\012 })\012end\012\012sourcet[\042until-closed\042] = function(sock)\012 local done\012 return base.setmetatable({\012 getfd = function() return sock:getfd() end,\012 dirty = function() return sock:dirty() end\012 }, {\012 __call = function()\012 if done then return nil end\012 local chunk, err, partial = sock:receive(socket.BLOCKSIZE)\012 if not err then return chunk\012 elseif err == \042closed\042 then\012 sock:close()\012 done = 1\012 return partial\012 else return nil, err end\012 end\012 })\012end\012\012\012sourcet[\042default\042] = sourcet[\042until-closed\042]\012\012source = choose(sourcet)\012\012"; diff --git a/src/lua/socket/socket.lua.h b/src/lua/socket/socket.lua.h index 6642fc81d1..9bc789240a 100644 --- a/src/lua/socket/socket.lua.h +++ b/src/lua/socket/socket.lua.h @@ -1,2 +1,2 @@ -#include "../luainc.h" +#include "../LuaCompat.h" void luaopen_socket(lua_State *l); diff --git a/src/lua/socket/tcp.c b/src/lua/socket/tcp.c index ca133b836a..2b06ed2b79 100644 --- a/src/lua/socket/tcp.c +++ b/src/lua/socket/tcp.c @@ -35,7 +35,7 @@ static int meth_setfd(lua_State *L); static int meth_dirty(lua_State *L); /* tcp object methods */ -static luaL_reg tcp[] = { +static luaL_Reg tcp[] = { {"__gc", meth_close}, {"__tostring", auxiliar_tostring}, {"accept", meth_accept}, @@ -70,7 +70,7 @@ static t_opt opt[] = { }; /* functions in library namespace */ -static luaL_reg func[] = { +static luaL_Reg func[] = { {"tcp", global_create}, {NULL, NULL} }; diff --git a/src/lua/socket/tcp.h b/src/lua/socket/tcp.h index 9178c86f1d..6bd59317a2 100644 --- a/src/lua/socket/tcp.h +++ b/src/lua/socket/tcp.h @@ -16,7 +16,7 @@ * * RCS ID: $Id: tcp.h,v 1.7 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" #include "buffer.h" #include "timeout.h" diff --git a/src/lua/socket/timeout.c b/src/lua/socket/timeout.c index 66aee12ea8..e686d6347a 100644 --- a/src/lua/socket/timeout.c +++ b/src/lua/socket/timeout.c @@ -30,7 +30,7 @@ static int timeout_lua_gettime(lua_State *L); static int timeout_lua_sleep(lua_State *L); -static luaL_reg func[] = { +static luaL_Reg func[] = { { "gettime", timeout_lua_gettime }, { "sleep", timeout_lua_sleep }, { NULL, NULL } diff --git a/src/lua/socket/timeout.h b/src/lua/socket/timeout.h index 7a0841833b..5584ab10de 100644 --- a/src/lua/socket/timeout.h +++ b/src/lua/socket/timeout.h @@ -6,7 +6,7 @@ * * RCS ID: $Id: timeout.h,v 1.14 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" /* timeout control structure */ typedef struct t_timeout_ { diff --git a/src/lua/socket/udp.c b/src/lua/socket/udp.c index 50c4e60e51..d863b549a3 100644 --- a/src/lua/socket/udp.c +++ b/src/lua/socket/udp.c @@ -40,7 +40,7 @@ static int meth_setfd(lua_State *L); static int meth_dirty(lua_State *L); /* udp object methods */ -static luaL_reg udp[] = { +static luaL_Reg udp[] = { {"__gc", meth_close}, {"__tostring", auxiliar_tostring}, {"close", meth_close}, @@ -73,7 +73,7 @@ static t_opt opt[] = { }; /* functions in library namespace */ -static luaL_reg func[] = { +static luaL_Reg func[] = { {"udp", global_create}, {NULL, NULL} }; diff --git a/src/lua/socket/udp.h b/src/lua/socket/udp.h index 3fefbc8fe4..e2383e56d6 100644 --- a/src/lua/socket/udp.h +++ b/src/lua/socket/udp.h @@ -14,7 +14,7 @@ * * RCS ID: $Id: udp.h,v 1.10 2005/10/07 04:40:59 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" #include "timeout.h" #include "socket.h" diff --git a/src/lua/socket/unix.c b/src/lua/socket/unix.c index fc9b487e37..086d34e092 100644 --- a/src/lua/socket/unix.c +++ b/src/lua/socket/unix.c @@ -37,7 +37,7 @@ static const char *unix_tryconnect(p_unix un, const char *path); static const char *unix_trybind(p_unix un, const char *path); /* unix object methods */ -static luaL_reg un[] = { +static luaL_Reg un[] = { {"__gc", meth_close}, {"__tostring", auxiliar_tostring}, {"accept", meth_accept}, @@ -69,7 +69,7 @@ static t_opt opt[] = { }; /* our socket creation function */ -static luaL_reg func[] = { +static luaL_Reg func[] = { {"unix", global_create}, {NULL, NULL} }; diff --git a/src/lua/socket/unix.h b/src/lua/socket/unix.h index 9f23a05a22..491b6466c4 100644 --- a/src/lua/socket/unix.h +++ b/src/lua/socket/unix.h @@ -10,7 +10,7 @@ * * RCS ID: $Id: unix.h,v 1.9 2006/03/13 07:16:39 diego Exp $ \*=========================================================================*/ -#include "../luainc.h" +#include "../LuaCompat.h" #include "buffer.h" #include "timeout.h"