From 13a6b935aa4ca4835f83a96a64c31f87c1dcee29 Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 22 May 2015 00:08:40 +0200 Subject: [PATCH] Avoid the missing-prototypes warning Warning option -Wmissing-prototypes raises a warning for all functions that are neither static nor in a header. Some functions should be available only for main.c but not in the official header (civetweb.h) since they are subject to changes. In order to avoid this warning, additional headers outside the include folder must be added. --- src/lua_civet.h | 4 ++++ src/main.c | 3 ++- src/mod_lua.inl | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/lua_civet.h diff --git a/src/lua_civet.h b/src/lua_civet.h new file mode 100644 index 00000000..e80fe609 --- /dev/null +++ b/src/lua_civet.h @@ -0,0 +1,4 @@ +/* "lua_civet.h" */ +/* Project internal header to allow main.c to call a non-public function in mod_lua.inl */ + +void lua_civet_open_all_libs(lua_State *L); diff --git a/src/main.c b/src/main.c index 1052358a..721f1fd1 100644 --- a/src/main.c +++ b/src/main.c @@ -641,7 +641,8 @@ static void set_absolute_path(char *options[], #ifdef USE_LUA #include "lua.h" #include "lauxlib.h" -extern void lua_civet_open_all_libs(lua_State *L); +#include "lua_civet.h" + static int run_lua(const char *file_name) { diff --git a/src/mod_lua.inl b/src/mod_lua.inl index 3fe4c44c..2c6b0f7f 100644 --- a/src/mod_lua.inl +++ b/src/mod_lua.inl @@ -1,5 +1,6 @@ #include #include +#include "lua_civet.h" #ifdef _WIN32 static void *