Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make XBT_TEST_UNIT() work in C++
[simgrid.git] / include / xbt / cunit.h
index 7a3c876..9da1a24 100644 (file)
@@ -117,10 +117,15 @@ XBT_PUBLIC(void) xbt_test_exit(void);
  * @param func a valid function name that will be used to contain all code of this unit
  * @param title human informative description of your test (displayed in testall)
  */
+#ifdef __cplusplus
+#define XBT_TEST_UNIT(name,func,title)    \
+    extern "C" void func(void);  /*prototype*/ \
+    void func(void)
+#else
 #define XBT_TEST_UNIT(name,func,title)    \
     void func(void);  /*prototype*/       \
     void func(void)
-
+#endif
 
 /* test operations */
 XBT_PUBLIC(void) _xbt_test_add(const char *file, int line, const char *fmt,