tolua creates sources that abuse the LUALIB_API defines.

Manually fixing the generated files so they don't try to declare dllimports.
This commit is contained in:
Enno Rehling 2021-02-13 20:48:19 +01:00
parent 73b2895306
commit d1ec2bbb5c
9 changed files with 33 additions and 38 deletions

View File

@ -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)

View File

@ -15,8 +15,8 @@
#include <string.h>
/* 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");

View File

@ -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? */

View File

@ -15,8 +15,8 @@
#include <string.h>
/* 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");

View File

@ -15,8 +15,8 @@
#include <string.h>
/* 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");

View File

@ -15,8 +15,8 @@
#include <string.h>
/* 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");

View File

@ -15,8 +15,8 @@
#include <string.h>
/* 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");

View File

@ -7,16 +7,11 @@
#ifndef __cplusplus
#include <stdlib.h>
#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 <string.h>
/* 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");

View File

@ -15,8 +15,8 @@
#include <string.h>
/* 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");