Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix compilation without MC.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sun, 28 Oct 2012 10:58:04 +0000 (11:58 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sun, 28 Oct 2012 10:58:04 +0000 (11:58 +0100)
src/simix/smx_smurf.c
src/simix/smx_smurf_private.h
src/simix/smx_user.c

index f3ebc52..d5a93fc 100644 (file)
@@ -558,6 +558,7 @@ void SIMIX_simcall_pre(smx_simcall_t simcall, int value)
       SIMIX_simcall_answer(simcall);
       break;
 
+#ifdef HAVE_MC
     case SIMCALL_MC_SNAPSHOT:
       simcall->mc_snapshot.s = MC_take_snapshot_liveness();
       SIMIX_simcall_answer(simcall);
@@ -568,7 +569,8 @@ void SIMIX_simcall_pre(smx_simcall_t simcall, int value)
         snapshot_compare(simcall->mc_compare_snapshots.snapshot1, simcall->mc_compare_snapshots.snapshot2);
       SIMIX_simcall_answer(simcall);
       break;
-   
+#endif /* HAVE_MC */
+
     case SIMCALL_NONE:
       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
           SIMIX_process_get_name(simcall->issuer),
index 2009207..ad7ef06 100644 (file)
@@ -98,8 +98,6 @@ SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_STAT), \
 SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_UNLINK),\
 SIMCALL_ENUM_ELEMENT(SIMCALL_FILE_LS),\
 SIMCALL_ENUM_ELEMENT(SIMCALL_ASR_GET_PROPERTIES), \
-SIMCALL_ENUM_ELEMENT(SIMCALL_MC_SNAPSHOT), \
-SIMCALL_ENUM_ELEMENT(SIMCALL_MC_COMPARE_SNAPSHOTS), \
 /* ****************************************************************************************** */ \
 /* TUTORIAL: New API                                                                        */ \
 /* ****************************************************************************************** */ \
@@ -122,8 +120,16 @@ SIMCALL_ENUM_ELEMENT(SIMCALL_NEW_API_INIT)
 #define SIMCALL_LIST3
 #endif
 
+#ifdef HAVE_MC
+#define SIMCALL_LIST4                                        \
+  ,SIMCALL_ENUM_ELEMENT(SIMCALL_MC_SNAPSHOT)                 \
+  ,SIMCALL_ENUM_ELEMENT(SIMCALL_MC_COMPARE_SNAPSHOTS)
+#else
+#define SIMCALL_LIST4
+#endif
+
 /* SIMCALL_LIST is the final macro to use */
-#define SIMCALL_LIST SIMCALL_LIST1 SIMCALL_LIST2 SIMCALL_LIST3
+#define SIMCALL_LIST SIMCALL_LIST1 SIMCALL_LIST2 SIMCALL_LIST3 SIMCALL_LIST4
 
 /* you can redefine the following macro differently to generate something else
  * with the list of enumeration values (e.g. a table of strings or a table of function pointers) */
index 84ce825..1fe90b1 100644 (file)
@@ -1651,6 +1651,8 @@ xbt_dict_t simcall_file_ls(const char* mount, const char* path)
   return simcall->file_ls.result;
 }
 
+#ifdef HAVE_MC
+
 void *simcall_mc_snapshot(void)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
@@ -1676,6 +1678,7 @@ int simcall_mc_compare_snapshots(void *s1, void *s2){
   return simcall->mc_compare_snapshots.result;
 }
 
+#endif /* HAVE_MC */
 
 /* ****************************************************************************************** */
 /* TUTORIAL: New API                                                                          */