From: Arnaud Giersch Date: Thu, 10 Jan 2019 12:52:22 +0000 (+0100) Subject: Remove typedef alias xbt_ex_t. X-Git-Tag: v3_22~606 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ef895bbb1784eda4b7f274eafad19c602cef75f5?ds=sidebyside Remove typedef alias xbt_ex_t. This removes the last references to struct xbt_ex in C world. --- diff --git a/include/xbt/cunit.h b/include/xbt/cunit.h index e2f1ac949b..5b9ee2df29 100644 --- a/include/xbt/cunit.h +++ b/include/xbt/cunit.h @@ -10,7 +10,9 @@ #ifndef XBT_CUNIT_H_ #define XBT_CUNIT_H_ -#include +#ifdef __cplusplus +#include +#endif #include /* 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__) +#ifdef __cplusplus /** @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(); diff --git a/include/xbt/ex.h b/include/xbt/ex.h index 0ba034c65f..45241064ff 100644 --- a/include/xbt/ex.h +++ b/include/xbt/ex.h @@ -52,8 +52,6 @@ SG_BEGIN_DECL() */ 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); diff --git a/src/xbt/cunit.cpp b/src/xbt/cunit.cpp index 2b136ce876..5076c2ee9f 100644 --- a/src/xbt/cunit.cpp +++ b/src/xbt/cunit.cpp @@ -579,7 +579,7 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...) 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());