Forráskód Böngészése

Clean Lua for different define configurations, avoid warnings

bel 11 éve
szülő
commit
b32232d2e1
1 módosított fájl, 6 hozzáadás és 3 törlés
  1. 6 3
      src/mod_lua.inl

+ 6 - 3
src/mod_lua.inl

@@ -754,7 +754,8 @@ static int lwebsock_write(lua_State *L)
     } else {
         return luaL_error(L, "invalid websocket write() call");
     }
-
+#else
+	(void)(L); /* unused */
 #endif
     return 0;
 }
@@ -818,7 +819,7 @@ static int lua_action_free(struct laction_arg *arg)
 
 static int lwebsocket_set_timer(lua_State *L, int is_periodic)
 {
-#ifdef USE_TIMERS
+#if defined(USE_TIMERS) && defined(USE_WEBSOCKET)
     int num_args = lua_gettop(L);
     struct lua_websock_data *ws;
     int type1,type2, ok = 0;
@@ -867,6 +868,8 @@ static int lwebsocket_set_timer(lua_State *L, int is_periodic)
     return 1;
 
 #else
+    (void)(L);           /* unused */
+    (void)(is_periodic); /* unused */
     return 0;
 #endif
 }
@@ -956,7 +959,7 @@ static void prepare_lua_environment(struct mg_context * ctx, struct mg_connectio
         luaopen_lsqlite3(L);
     }
 #endif
-#ifdef USE_LUA_SQLITE3
+#ifdef USE_LUA_LUAXML
     {
         extern int luaopen_LuaXML(lua_State *);
         luaopen_LuaXML(L);