Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove typedef alias xbt_ex_t.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 10 Jan 2019 12:52:22 +0000 (13:52 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 10 Jan 2019 12:53:53 +0000 (13:53 +0100)
This removes the last references to struct xbt_ex in C world.

include/xbt/cunit.h
include/xbt/ex.h
src/xbt/cunit.cpp

index e2f1ac9..5b9ee2d 100644 (file)
@@ -10,7 +10,9 @@
 #ifndef XBT_CUNIT_H_
 #define XBT_CUNIT_H_
 
 #ifndef XBT_CUNIT_H_
 #define XBT_CUNIT_H_
 
-#include <xbt/ex.h>
+#ifdef __cplusplus
+#include <simgrid/Exception.hpp>
+#endif
 #include <xbt/sysdep.h> /* XBT_ATTRIB_PRINTF */
 
 SG_BEGIN_DECL()
 #include <xbt/sysdep.h> /* XBT_ATTRIB_PRINTF */
 
 SG_BEGIN_DECL()
@@ -123,8 +125,10 @@ XBT_PUBLIC void _xbt_test_log(const char* file, int line, const char* fmt, ...)
  *  @hideinitializer  */
 #define xbt_test_log(...)       _xbt_test_log(__FILE__, __LINE__, __VA_ARGS__)
 
  *  @hideinitializer  */
 #define xbt_test_log(...)       _xbt_test_log(__FILE__, __LINE__, __VA_ARGS__)
 
+#ifdef __cplusplus
 /** @brief Declare that the lastly started test failed because of the provided exception */
 /** @brief Declare that the lastly started test failed because of the provided exception */
-XBT_PUBLIC void xbt_test_exception(xbt_ex_t e);
+XBT_PUBLIC void xbt_test_exception(xbt_ex e);
+#endif
 
 /** @brief Declare that the lastly started test was expected to fail (and actually failed) */
 XBT_PUBLIC void xbt_test_expect_failure();
 
 /** @brief Declare that the lastly started test was expected to fail (and actually failed) */
 XBT_PUBLIC void xbt_test_expect_failure();
index 0ba034c..4524106 100644 (file)
@@ -52,8 +52,6 @@ SG_BEGIN_DECL()
  */
 XBT_PUBLIC const char* xbt_ex_catname(xbt_errcat_t cat);
 
  */
 XBT_PUBLIC const char* xbt_ex_catname(xbt_errcat_t cat);
 
-typedef struct xbt_ex xbt_ex_t;
-
 /** Helper function used to throw exceptions in C */
 XBT_ATTRIB_NORETURN XBT_PUBLIC void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file,
                                                int line, const char* func);
 /** Helper function used to throw exceptions in C */
 XBT_ATTRIB_NORETURN XBT_PUBLIC void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file,
                                                int line, const char* func);
index 2b136ce..5076c2e 100644 (file)
@@ -579,7 +579,7 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...)
   test.failed_ = true;
 }
 
   test.failed_ = true;
 }
 
-void xbt_test_exception(xbt_ex_t e)
+void xbt_test_exception(xbt_ex e)
 {
   _xbt_test_fail(e.throw_point().file_, e.throw_point().line_, "Exception %s raised: %s", xbt_ex_catname(e.category),
                  e.what());
 {
   _xbt_test_fail(e.throw_point().file_, e.throw_point().line_, "Exception %s raised: %s", xbt_ex_catname(e.category),
                  e.what());