MSVC: disable level 4 warning C4100 for tolua-generated code (unused variable)

make a single object from all generated binding code.
this setup is unusual, but easier to maintain.
This commit is contained in:
Enno Rehling 2014-08-14 19:39:17 +02:00
parent ff73358b9c
commit 804734d013
18 changed files with 58 additions and 14 deletions

View File

@ -93,13 +93,7 @@ set(SERVER_SRC
building_action.c
console.c
helpers.c
config.pkg.c
eressea.pkg.c
game.pkg.c
locale.pkg.c
log.pkg.c
process.pkg.c
settings.pkg.c
bind_tolua.c
bind_building.c
bind_config.c
bind_locale.c

19
src/bind_tolua.c Normal file
View File

@ -0,0 +1,19 @@
#pragma warning(push)
#pragma warning(disable: 4100)
#include "config.pkg.c"
#include "eressea.pkg.c"
#include "game.pkg.c"
#include "locale.pkg.c"
#include "log.pkg.c"
#include "process.pkg.c"
#include "settings.pkg.c"
void tolua_bind_open(lua_State * L) {
tolua_eressea_open(L);
tolua_process_open(L);
tolua_settings_open(L);
tolua_game_open(L);
tolua_config_open(L);
tolua_locale_open(L);
tolua_log_open(L);
}

5
src/bind_tolua.h Normal file
View File

@ -0,0 +1,5 @@
#ifndef BIND_TOLUA_H
#define BIND_TOLUA_H
struct lua_State;
void tolua_bind_open(struct lua_State * L);
#endif

View File

@ -1062,17 +1062,13 @@ static void parse_inifile(lua_State * L, dictionary * d, const char *section)
}
}
void tolua_bind_open(lua_State * L);
int tolua_bindings_open(lua_State * L)
{
tolua_open(L);
tolua_eressea_open(L);
tolua_process_open(L);
tolua_settings_open(L);
tolua_game_open(L);
tolua_config_open(L);
tolua_locale_open(L);
tolua_log_open(L);
tolua_bind_open(L);
/* register user types */
tolua_usertype(L, TOLUA_CAST "spell");

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_config
$#include "bind_config.h"
module eressea {

View File

@ -18,6 +18,8 @@
TOLUA_API int tolua_config_open (lua_State* tolua_S);
LUALIB_API int luaopen_config (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_config
#include "bind_config.h"
/* function to register type */

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_eressea
$#include "bind_eressea.h"
module eressea {

View File

@ -18,6 +18,9 @@
TOLUA_API int tolua_eressea_open (lua_State* tolua_S);
LUALIB_API int luaopen_eressea (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_eressea
#include "bind_tolua.h"
#include "bind_eressea.h"
/* function to register type */

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_game
$#include "config.h"
$#include "bind_eressea.h"

View File

@ -18,6 +18,8 @@
TOLUA_API int tolua_game_open (lua_State* tolua_S);
LUALIB_API int luaopen_game (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_game
#include "config.h"
#include "bind_eressea.h"

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_locale
$#include "bind_locale.h"
module eressea {

View File

@ -18,6 +18,9 @@
TOLUA_API int tolua_locale_open (lua_State* tolua_S);
LUALIB_API int luaopen_locale (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_locale
#include "bind_tolua.h"
#include "bind_locale.h"
/* function to register type */

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_log
$#include <util/log.h>
module eressea {

View File

@ -18,6 +18,8 @@
TOLUA_API int tolua_log_open (lua_State* tolua_S);
LUALIB_API int luaopen_log (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_log
#include <util/log.h>
/* function to register type */

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_process
$#include "bind_process.h"
module eressea {

View File

@ -18,6 +18,8 @@
TOLUA_API int tolua_process_open (lua_State* tolua_S);
LUALIB_API int luaopen_process (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_process
#include "bind_process.h"
/* function to register type */

View File

@ -1,3 +1,5 @@
$#undef tolua_reg_types
$#define tolua_reg_types tolua_reg_types_config
$#include "bind_settings.h"
module eressea {

View File

@ -18,6 +18,8 @@
TOLUA_API int tolua_settings_open (lua_State* tolua_S);
LUALIB_API int luaopen_settings (lua_State* tolua_S);
#undef tolua_reg_types
#define tolua_reg_types tolua_reg_types_settings
#include "bind_settings.h"
/* function to register type */