From 1e896e691f69c6e46566d038d37b4fd7ea18fa3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20B=C3=A9daride?= Date: Tue, 18 Dec 2012 10:01:10 +0100 Subject: [PATCH] Fix _sg_do_model_check use with model_check=OFF --- src/mc/mc_global.c | 1 - src/simgrid/sg_config.c | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index d935b75496..394d2a9908 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -31,7 +31,6 @@ int _sg_mc_timeout=0; int _sg_mc_max_depth=1000; int _sg_mc_visited=0; - extern int _sg_init_status; void _mc_cfg_cb_reduce(const char *name, int pos) { if (_sg_init_status && !_sg_do_model_check) { diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index db7de62927..e647b9d920 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -234,14 +234,16 @@ static void _sg_cfg_cb__surf_path(const char *name, int pos) /* callback to decide if we want to use the model-checking */ #include "xbt_modinter.h" +#ifdef HAVE_MC extern int _sg_do_model_check; /* this variable lives in xbt_main until I find a right location for it */ +#endif static void _sg_cfg_cb_model_check(const char *name, int pos) { +#ifdef HAVE_MC _sg_do_model_check = xbt_cfg_get_int(_sg_cfg_set, name); - -#ifndef HAVE_MC - if (_sg_do_model_check) { +#else + if (xbt_cfg_get_int(_sg_cfg_set, name)) { xbt_die("You tried to activate the model-checking from the command line, but it was not compiled in. Change your settings in cmake, recompile and try again"); } #endif -- 2.20.1