From: Martin Quinson Date: Sun, 7 Feb 2016 23:13:42 +0000 (+0100) Subject: Protect every lua header with extern 'C' X-Git-Tag: v3_13~933 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/14f459baf40f29906d54d3bd5774cda34aeadd76 Protect every lua header with extern 'C' --- diff --git a/src/bindings/lua/lua_host.cpp b/src/bindings/lua/lua_host.cpp index 804b672a7e..cf6e1abb7c 100644 --- a/src/bindings/lua/lua_host.cpp +++ b/src/bindings/lua/lua_host.cpp @@ -7,8 +7,10 @@ /* SimGrid Lua bindings */ #include "lua_private.h" -#include #include +extern "C" { +#include +} XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_host, bindings, "Lua bindings (host module)"); diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 4f7507b33c..f5037bfc60 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -12,7 +12,10 @@ #include "surf/surf_routing.h" #include #include + +extern "C" { #include +} #include #include "src/surf/surf_private.h" diff --git a/src/bindings/lua/lua_private.h b/src/bindings/lua/lua_private.h index e6b393eedc..63472f0013 100644 --- a/src/bindings/lua/lua_private.h +++ b/src/bindings/lua/lua_private.h @@ -6,8 +6,13 @@ /* SimGrid Lua bindings */ -#include "simgrid_lua.h" +#ifndef LUA_PRIVATE_H +#define LUA_PRIVATE_H + #include "simgrid/msg.h" +#include "simgrid_lua.h" + +extern "C" { void sglua_register_host_functions(lua_State* L); msg_host_t sglua_check_host(lua_State* L, int index); @@ -15,3 +20,7 @@ msg_host_t sglua_check_host(lua_State* L, int index); void sglua_register_platf_functions(lua_State* L); const char* sglua_get_msg_error(msg_error_t err); + +} + +#endif /* LUA_PRIVATE_H */ diff --git a/src/bindings/lua/simgrid_lua.cpp b/src/bindings/lua/simgrid_lua.cpp index 40c9c8de91..ce5fed9bc4 100644 --- a/src/bindings/lua/simgrid_lua.cpp +++ b/src/bindings/lua/simgrid_lua.cpp @@ -12,12 +12,13 @@ #include "simgrid/msg.h" #include "simgrid/simdag.h" #include "surf/surfxml_parse.h" -#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings"); extern "C" { +#include + int luaopen_simgrid(lua_State *L); static void sglua_register_c_functions(lua_State *L); } diff --git a/src/bindings/lua/simgrid_lua.h b/src/bindings/lua/simgrid_lua.h index dea4da47ff..d5162e6eed 100644 --- a/src/bindings/lua/simgrid_lua.h +++ b/src/bindings/lua/simgrid_lua.h @@ -7,6 +7,7 @@ #ifndef SIMGRID_LUA_H #define SIMGRID_LUA_H +extern "C" { #include /* ********************************************************************************* */ @@ -27,5 +28,5 @@ int console_AS_open(lua_State*); int console_AS_close(lua_State *L); int console_set_function(lua_State*); int console_host_set_property(lua_State*); - +} #endif /* SIMGRID_LUA_H */