From 3de97294ca67a79f4a9729fc7ebcf37b4392f427 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Fri, 16 Oct 2015 11:37:31 +0200 Subject: [PATCH] Fix build without lua --- src/surf/surfxml_parseplatf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/surf/surfxml_parseplatf.c b/src/surf/surfxml_parseplatf.c index 9333659b38..238d3282a0 100644 --- a/src/surf/surfxml_parseplatf.c +++ b/src/surf/surfxml_parseplatf.c @@ -11,12 +11,15 @@ #include "simgrid/platf.h" #include "surf/surfxml_parse.h" #include "surf/surf_private.h" + +#ifdef HAVE_LUA #include "bindings/lua/simgrid_lua.h" #include "bindings/lua/lua_state_cloner.h" #include /* Always include this when calling Lua */ #include /* Always include this when calling Lua */ #include /* Prototype for luaL_openlibs(), */ +#endif XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse); @@ -94,11 +97,14 @@ void parse_after_config() { /* This function acts as a main in the parsing area. */ void parse_platform_file(const char *file) { +#ifdef HAVE_LUA int is_lua = (file != NULL && strlen(file) > 3 && file[strlen(file)-3] == 'l' && file[strlen(file)-2] == 'u' && file[strlen(file)-1] == 'a'); +#endif surf_parse_init_callbacks(); +#ifdef HAVE_LUA /* Check if file extension is "lua". If so, we will use * the lua bindings to parse the platform file (since it is * written in lua). If not, we will use the (old?) XML parser @@ -139,7 +145,9 @@ void parse_platform_file(const char *file) } } - else { // Use XML parser + else +#endif + { // Use XML parser int parse_status; -- 2.20.1