Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Protect every lua header with extern 'C'
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 23:13:42 +0000 (00:13 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 23:13:42 +0000 (00:13 +0100)
src/bindings/lua/lua_host.cpp
src/bindings/lua/lua_platf.cpp
src/bindings/lua/lua_private.h
src/bindings/lua/simgrid_lua.cpp
src/bindings/lua/simgrid_lua.h

index 804b672a7e92819d9a4c33803b4f7122ffefd434..cf6e1abb7ce063b33c15283dd4514a6661f4f813 100644 (file)
@@ -7,8 +7,10 @@
 /* SimGrid Lua bindings                                                     */
 
 #include "lua_private.h"
 /* SimGrid Lua bindings                                                     */
 
 #include "lua_private.h"
-#include <lauxlib.h>
 #include <simgrid/host.h>
 #include <simgrid/host.h>
+extern "C" {
+#include <lauxlib.h>
+}
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_host, bindings, "Lua bindings (host module)");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_host, bindings, "Lua bindings (host module)");
 
index 4f7507b33c424568eb0ffe35d66e2faecd8d0e71..f5037bfc60b5542721118387a59f725224c10197 100644 (file)
 #include "surf/surf_routing.h"
 #include <string.h>
 #include <ctype.h>
 #include "surf/surf_routing.h"
 #include <string.h>
 #include <ctype.h>
+
+extern "C" {
 #include <lauxlib.h>
 #include <lauxlib.h>
+}
 
 #include <simgrid/host.h>
 #include "src/surf/surf_private.h"
 
 #include <simgrid/host.h>
 #include "src/surf/surf_private.h"
index e6b393eedc3b9c2d4a35706c671c414bc0542ca6..63472f001389333995fa8d3b883b82e44b4fdbc8 100644 (file)
@@ -6,8 +6,13 @@
 
 /* SimGrid Lua bindings                                                     */
 
 
 /* SimGrid Lua bindings                                                     */
 
-#include "simgrid_lua.h"
+#ifndef LUA_PRIVATE_H
+#define LUA_PRIVATE_H
+
 #include "simgrid/msg.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);
 
 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);
 void sglua_register_platf_functions(lua_State* L);
 
 const char* sglua_get_msg_error(msg_error_t err);
+
+}
+
+#endif /* LUA_PRIVATE_H */
index 40c9c8de91327585b3239670c5c75129e9563646..ce5fed9bc4a29dafac4cfedb66f0882812657bde 100644 (file)
 #include "simgrid/msg.h"
 #include "simgrid/simdag.h"
 #include "surf/surfxml_parse.h"
 #include "simgrid/msg.h"
 #include "simgrid/simdag.h"
 #include "surf/surfxml_parse.h"
-#include <lauxlib.h>
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings");
 
 extern "C" {
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings");
 
 extern "C" {
+#include <lauxlib.h>
+
 int luaopen_simgrid(lua_State *L);
 static void sglua_register_c_functions(lua_State *L);
 }
 int luaopen_simgrid(lua_State *L);
 static void sglua_register_c_functions(lua_State *L);
 }
index dea4da47ff22edcdc8c3b27f7979d9db07ffca00..d5162e6eed5513ed974537f332254a856790e187 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef SIMGRID_LUA_H
 #define SIMGRID_LUA_H
 
 #ifndef SIMGRID_LUA_H
 #define SIMGRID_LUA_H
 
+extern "C" {
 #include <lua.h>
 
 /* ********************************************************************************* */
 #include <lua.h>
 
 /* ********************************************************************************* */
@@ -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*);
 int console_AS_close(lua_State *L);
 int console_set_function(lua_State*);
 int console_host_set_property(lua_State*);
-
+}
 #endif  /* SIMGRID_LUA_H */
 #endif  /* SIMGRID_LUA_H */