Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
It have to call the correct functions.
[simgrid.git] / include / gras / emul.h
index 6d9b6d1..99b04f0 100644 (file)
 #ifndef GRAS_COND_H
 #define GRAS_COND_H
 
-#include "xbt/misc.h" /* BEGIN_DECL */
-
-BEGIN_DECL()
+#include "xbt/misc.h" /* SG_BEGIN_DECL */
 
+SG_BEGIN_DECL()
 /** @addtogroup GRAS_emul
  *  @brief Code execution "emulation" and "virtualization".
  * 
@@ -46,17 +45,17 @@ BEGIN_DECL()
  */
   
 /** \brief Returns true only if the program runs on real life */
-int gras_if_RL(void);
+XBT_PUBLIC(int) gras_if_RL(void);
 
 /** \brief Returns true only if the program runs within the simulator */
-int gras_if_SG(void);
+XBT_PUBLIC(int) gras_if_SG(void);
 
 /** @} */
 
-int gras_bench_always_begin(const char *location, int line);
-int gras_bench_always_end(void);
-int gras_bench_once_begin(const char *location, int line);
-int gras_bench_once_end(void);
+XBT_PUBLIC(int) gras_bench_always_begin(const char *location, int line);
+XBT_PUBLIC(int) gras_bench_always_end(void);
+XBT_PUBLIC(int) gras_bench_once_begin(const char *location, int line);
+XBT_PUBLIC(int) gras_bench_once_end(void);
 
 /** @addtogroup GRAS_emul
  *  \section GRAS_emul_timing Emulation
@@ -147,27 +146,27 @@ int gras_bench_once_end(void);
  */
 /** \brief Start benchmarking this code block
     \hideinitializer */
-#define GRAS_BENCH_ALWAYS_BEGIN()  do { if(gras_if_SG()) gras_bench_always_begin(__FILE__, __LINE__); } while(0)
+#define GRAS_BENCH_ALWAYS_BEGIN()           gras_bench_always_begin(__FILE__, __LINE__)
 /** \brief Stop benchmarking this code block
     \hideinitializer */
-#define GRAS_BENCH_ALWAYS_END() do { if(gras_if_SG()) gras_bench_always_end(); } while(0)
+#define GRAS_BENCH_ALWAYS_END()             gras_bench_always_end()
 
 /** \brief Start benchmarking this code block if it has never been benchmarked, run it in any case
  *  \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ALWAYS_BEGIN()  do { if(gras_if_SG()) gras_bench_once_begin(__FILE__, __LINE__); } while(0)
+#define GRAS_BENCH_ONCE_RUN_ALWAYS_BEGIN()  gras_bench_once_begin(__FILE__, __LINE__)
 /** \brief Stop benchmarking this part of the code
     \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ALWAYS_END()    do { if(gras_if_SG()) gras_bench_once_end(); } while(0)
+#define GRAS_BENCH_ONCE_RUN_ALWAYS_END()    gras_bench_once_end()
 
 /** \brief Start benchmarking this code block if it has never been benchmarked, ignore it if it was
     \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ONCE_BEGIN()  if((gras_if_SG()&&(gras_bench_once_begin(__FILE__, __LINE__)))||(gras_if_RL())) { 
+#define GRAS_BENCH_ONCE_RUN_ONCE_BEGIN()    if (gras_bench_once_begin(__FILE__, __LINE__)) { 
 /** \brief Stop benchmarking this part of the code
     \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ONCE_END()    } GRAS_BENCH_ONCE_RUN_ALWAYS_END();
+#define GRAS_BENCH_ONCE_RUN_ONCE_END()      } gras_bench_once_end()
 /** @} */
 
-END_DECL()
+SG_END_DECL()
 
 #endif /* GRAS_COND_H */