diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index afb619f8c..6307fde41 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -307,24 +307,24 @@ if (SQLite3_FOUND) target_include_directories (game PRIVATE ${SQLite3_INCLUDE_DIRS}) target_link_libraries(eressea ${SQLite3_LIBRARIES}) target_link_libraries(test_eressea ${SQLite3_LIBRARIES}) -add_definitions(-DUSE_SQLITE) +add_compile_definitions(game PRIVATE USE_SQLITE) elseif (DB_FOUND) #include_directories (${DB_INCLUDE_DIR}) target_link_libraries(eressea ${DB_LIBRARIES}) target_link_libraries(test_eressea ${DB_LIBRARIES}) -add_definitions(-DUSE_DB) +add_compile_definitions(game PRIVATE USE_DB) endif(SQLite3_FOUND) if (READLINE_FOUND) #include_directories (${READLINE_INCLUDE_DIR}) target_link_libraries(eressea ${READLINE_LIBRARY}) -add_definitions(-DUSE_READLINE) +add_compile_definitions(eressea PRIVATE DUSE_READLINE) endif (READLINE_FOUND) if (CURSES_FOUND) target_include_directories (eressea PRIVATE ${CURSES_INCLUDE_DIRS}) target_link_libraries(eressea ${CURSES_LIBRARIES}) -add_definitions(-DUSE_CURSES) +add_compile_definitions(eressea PRIVATE USE_CURSES) endif(CURSES_FOUND) if (EXPAT_FOUND) diff --git a/src/config.pkg.c b/src/config.pkg.c index 38e1f8785..585ec2a55 100644 --- a/src/config.pkg.c +++ b/src/config.pkg.c @@ -15,8 +15,8 @@ #include /* Exported function */ -TOLUA_API int tolua_config_open (lua_State* tolua_S); -LUALIB_API int luaopen_config (lua_State* tolua_S); +int tolua_config_open (lua_State* tolua_S); +int luaopen_config (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_config @@ -108,7 +108,7 @@ static int tolua_config_eressea_config_parse00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_config (lua_State* tolua_S) +int luaopen_config (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -127,7 +127,7 @@ LUALIB_API int luaopen_config (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_config_open (lua_State* tolua_S) +int tolua_config_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_config); lua_pushstring(tolua_S, "config"); diff --git a/src/console.c b/src/console.c index 11e0e1f81..a13dc3982 100644 --- a/src/console.c +++ b/src/console.c @@ -199,7 +199,7 @@ static int loadline(lua_State * L) if (!pushline(L, 1)) return -1; /* no input */ for (;;) { /* repeat until gets a complete line */ - status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin"); + status = luaL_loadbuffer(L, lua_tostring(L, 1), (size_t)lua_strlen(L, 1), "=stdin"); if (!incomplete(L, status)) break; /* cannot try to add lines? */ if (!pushline(L, 0)) /* no more input? */ diff --git a/src/eressea.pkg.c b/src/eressea.pkg.c index 9318d975d..2a41eac38 100644 --- a/src/eressea.pkg.c +++ b/src/eressea.pkg.c @@ -15,8 +15,8 @@ #include /* Exported function */ -TOLUA_API int tolua_eressea_open (lua_State* tolua_S); -LUALIB_API int luaopen_eressea (lua_State* tolua_S); +int tolua_eressea_open (lua_State* tolua_S); +int luaopen_eressea (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_eressea @@ -190,7 +190,7 @@ static int tolua_eressea_eressea_import00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_eressea (lua_State* tolua_S) +int luaopen_eressea (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -209,7 +209,7 @@ LUALIB_API int luaopen_eressea (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_eressea_open (lua_State* tolua_S) +int tolua_eressea_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_eressea); lua_pushstring(tolua_S, "eressea"); diff --git a/src/game.pkg.c b/src/game.pkg.c index 30671021d..7fc23b0b0 100644 --- a/src/game.pkg.c +++ b/src/game.pkg.c @@ -15,8 +15,8 @@ #include /* Exported function */ -TOLUA_API int tolua_game_open (lua_State* tolua_S); -LUALIB_API int luaopen_game (lua_State* tolua_S); +int tolua_game_open (lua_State* tolua_S); +int luaopen_game (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_game @@ -162,7 +162,7 @@ static int tolua_game_eressea_game_import00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_game (lua_State* tolua_S) +int luaopen_game (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -183,7 +183,7 @@ LUALIB_API int luaopen_game (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_game_open (lua_State* tolua_S) +int tolua_game_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_game); lua_pushstring(tolua_S, "game"); diff --git a/src/locale.pkg.c b/src/locale.pkg.c index 1792b742e..01d83c681 100644 --- a/src/locale.pkg.c +++ b/src/locale.pkg.c @@ -15,8 +15,8 @@ #include /* Exported function */ -TOLUA_API int tolua_locale_open (lua_State* tolua_S); -LUALIB_API int luaopen_locale (lua_State* tolua_S); +int tolua_locale_open (lua_State* tolua_S); +int luaopen_locale (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_locale @@ -142,7 +142,7 @@ static int tolua_locale_eressea_locale_direction00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_locale (lua_State* tolua_S) +int luaopen_locale (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -162,7 +162,7 @@ LUALIB_API int luaopen_locale (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_locale_open (lua_State* tolua_S) +int tolua_locale_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_locale); lua_pushstring(tolua_S, "locale"); diff --git a/src/log.pkg.c b/src/log.pkg.c index 4303a5c2d..92e405751 100644 --- a/src/log.pkg.c +++ b/src/log.pkg.c @@ -15,8 +15,8 @@ #include /* Exported function */ -TOLUA_API int tolua_log_open (lua_State* tolua_S); -LUALIB_API int luaopen_log (lua_State* tolua_S); +int tolua_log_open (lua_State* tolua_S); +int luaopen_log (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_log @@ -132,7 +132,7 @@ static int tolua_log_eressea_log_info00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_log (lua_State* tolua_S) +int luaopen_log (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -152,7 +152,7 @@ LUALIB_API int luaopen_log (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_log_open (lua_State* tolua_S) +int tolua_log_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_log); lua_pushstring(tolua_S, "log"); diff --git a/src/process.pkg.c b/src/process.pkg.c index 3e818f7ce..f739528b7 100644 --- a/src/process.pkg.c +++ b/src/process.pkg.c @@ -7,16 +7,11 @@ #ifndef __cplusplus #include #endif -#ifdef __cplusplus - extern "C" int tolua_bnd_takeownership (lua_State* L); // from tolua_map.c -#else - int tolua_bnd_takeownership (lua_State* L); /* from tolua_map.c */ -#endif #include /* Exported function */ -TOLUA_API int tolua_process_open (lua_State* tolua_S); -LUALIB_API int luaopen_process (lua_State* tolua_S); +int tolua_process_open (lua_State* tolua_S); +int luaopen_process (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_process @@ -942,7 +937,7 @@ static int tolua_process_eressea_process_set_default00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_process (lua_State* tolua_S) +int luaopen_process (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -996,7 +991,7 @@ LUALIB_API int luaopen_process (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_process_open (lua_State* tolua_S) +int tolua_process_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_process); lua_pushstring(tolua_S, "process"); diff --git a/src/settings.pkg.c b/src/settings.pkg.c index 79ea280cb..fbb3d242d 100644 --- a/src/settings.pkg.c +++ b/src/settings.pkg.c @@ -15,8 +15,8 @@ #include /* Exported function */ -TOLUA_API int tolua_settings_open (lua_State* tolua_S); -LUALIB_API int luaopen_settings (lua_State* tolua_S); +int tolua_settings_open (lua_State* tolua_S); +int luaopen_settings (lua_State* tolua_S); #undef tolua_reg_types #define tolua_reg_types tolua_reg_types_settings @@ -83,7 +83,7 @@ static int tolua_settings_eressea_settings_get00(lua_State* tolua_S) } /* Open lib function */ -LUALIB_API int luaopen_settings (lua_State* tolua_S) +int luaopen_settings (lua_State* tolua_S) { tolua_open(tolua_S); tolua_reg_types(tolua_S); @@ -101,7 +101,7 @@ LUALIB_API int luaopen_settings (lua_State* tolua_S) return 1; } /* Open tolua function */ -TOLUA_API int tolua_settings_open (lua_State* tolua_S) +int tolua_settings_open (lua_State* tolua_S) { lua_pushcfunction(tolua_S, luaopen_settings); lua_pushstring(tolua_S, "settings");