diff mbox series

[1/2] fix: LuaJIT build issue due to duplicate definitions

Message ID 20240917070633.50683-1-michael.adler@siemens.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series [1/2] fix: LuaJIT build issue due to duplicate definitions | expand

Commit Message

Michael Adler Sept. 17, 2024, 7:06 a.m. UTC
This commit addresses a problem where `struct luaL_Stream` is defined
twice when building with LuaJIT, resulting in a redefinition compile
error.

Signed-off-by: Michael Adler <michael.adler@siemens.com>
Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 include/lua_util.h | 43 -------------------------------------------
 1 file changed, 43 deletions(-)
diff mbox series

Patch

diff --git a/include/lua_util.h b/include/lua_util.h
index 55240e41..68b3dea8 100644
--- a/include/lua_util.h
+++ b/include/lua_util.h
@@ -50,49 +50,6 @@  static inline int lua_isinteger (lua_State *L, int index) {
 }
 #endif
 
-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM == 501
-#define LUA_OK 0
-#if !defined(luaL_newlib)
-#define luaL_newlib(L, l) (lua_newtable((L)),luaL_setfuncs((L), (l), 0))
-#endif
-
-void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup);
-void luaL_requiref(lua_State *L, char const* modname, lua_CFunction openf, int glb);
-
-/*
- * See https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_Stream
- * on the reason for the absence of luaL_Stream's closef member and
- * compatibility with LuaJIT / Lua 5.1.
- */
-typedef struct luaL_Stream {
-  FILE *f;
-} luaL_Stream;
-
-typedef struct luaL_Buffer_52 {
-	luaL_Buffer b; /* make incorrect code crash! */
-	char *ptr;
-	size_t nelems;
-	size_t capacity;
-	lua_State *L2;
-} luaL_Buffer_52;
-#define luaL_Buffer luaL_Buffer_52
-
-#define luaL_prepbuffsize luaL_prepbuffsize_52
-char *luaL_prepbuffsize(luaL_Buffer_52 *B, size_t s);
-
-#define luaL_buffinit luaL_buffinit_52
-void luaL_buffinit(lua_State *L, luaL_Buffer_52 *B);
-
-#undef luaL_addsize
-#define luaL_addsize(B, s) ((B)->nelems += (s))
-
-#define luaL_pushresult luaL_pushresult_52
-void luaL_pushresult(luaL_Buffer_52 *B);
-
-#define luaL_checkversion(L) ((void)0)
-#define lua_rawlen(L, i) lua_objlen(L, i)
-#endif
-
 #else
 
 struct img_type;