This removes the last references to struct xbt_ex in C world.
#ifndef XBT_CUNIT_H_
#define XBT_CUNIT_H_
#ifndef XBT_CUNIT_H_
#define XBT_CUNIT_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()
* @hideinitializer */
#define xbt_test_log(...) _xbt_test_log(__FILE__, __LINE__, __VA_ARGS__)
* @hideinitializer */
#define xbt_test_log(...) _xbt_test_log(__FILE__, __LINE__, __VA_ARGS__)
/** @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();
*/
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);
-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());