LuaJIT and LuaSocket both define new Lua APIs from Lua 5.2 (in particular `luaL_setfuncs` and `luaL_testudata`). When linking both statically, the one definition rule strikes and linking fails. This commit fixes the issue by renaming the LuaSocket versions of those functions behind the scenes using the C preprocessor. Closes #214
14 lines
321 B
C
14 lines
321 B
C
#ifndef COMPAT_H
|
|
#define COMPAT_H
|
|
|
|
#include "lua.h"
|
|
#include "lauxlib.h"
|
|
|
|
#if LUA_VERSION_NUM==501
|
|
#define luaL_setfuncs socket_setfuncs
|
|
#define luaL_testudata socket_testudata
|
|
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
|
|
void *luaL_testudata ( lua_State *L, int arg, const char *tname);
|
|
#endif
|
|
|
|
#endif
|