Procházet zdrojové kódy

Add compatibility define for Lua5.4 (#905)

bel2125 před 4 roky
rodič
revize
22974ce240
2 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 1 1
      src/mod_lua.inl
  2. 6 0
      src/third_party/civetweb_lua.h

+ 1 - 1
src/mod_lua.inl

@@ -2389,7 +2389,7 @@ reg_gc(lua_State *L, void *conn)
 	/* Key element */
 	lua_pushlightuserdata(L, &lua_regkey_dtor);
 
-	/* Value element (for a table defined outside this function) */
+	/* Value element */
 	lua_newuserdata(L, 0);
 
 	/* Prepare metatable for value element */

+ 6 - 0
src/third_party/civetweb_lua.h

@@ -27,6 +27,9 @@
 #define CIVETWEB_LUA_H
 
 #define LUA_LIB
+#define LUA_COMPAT_LOG10
+#define LUA_COMPAT_APIINTCASTS
+
 #include "lauxlib.h"
 #include "lua.h"
 #include "lualib.h"
@@ -65,6 +68,9 @@
 /* Lua 5.4 detected */
 #define mg_lua_load lua_load
 
+#else
+#error "Lua version not supported (yet?)"
+
 #endif
 
 #ifdef LUA_VERSION_MAKEFILE