From 10db8d166e39dfa7a35dc2294865ad99416c9330 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 4 Sep 2017 22:44:04 +0200 Subject: [PATCH] Don't inline ~xbt_ex. Otherwise, xbt_ex is also defined in libsimgrid-java and some tests are broken with clang/libc++/freebsd. Thanks Gabriel if this works! --- include/xbt/ex.hpp | 4 ++-- src/xbt/ex.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/xbt/ex.hpp b/include/xbt/ex.hpp index efd8eee333..7e649738af 100644 --- a/include/xbt/ex.hpp +++ b/include/xbt/ex.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2005-2015. The SimGrid Team. +/* Copyright (c) 2005-2017. The SimGrid Team. * All rights reserved. */ /* Copyright (c) 2002-2004 Ralf S. Engelschall */ @@ -79,7 +79,7 @@ struct XBT_PUBLIC() xbt_ex : simgrid::xbt::WithContextException(throwpoint, simgrid::xbt::backtrace()) {} - ~xbt_ex() = default; + ~xbt_ex(); /** Category (what went wrong) */ xbt_errcat_t category = unknown_error; diff --git a/src/xbt/ex.cpp b/src/xbt/ex.cpp index 50a97f1666..f609b1d7c0 100644 --- a/src/xbt/ex.cpp +++ b/src/xbt/ex.cpp @@ -59,6 +59,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ex, xbt, "Exception mechanism"); +// Don't define ~xbt_ex() in ex.hpp. It is defined here to ensure that there is an unique definition of xt_ex in +// libsimgrid, but not in libsimgrid-java. Otherwise, sone tests are broken (seen with clang/libc++ on freebsd). +xbt_ex::~xbt_ex() = default; + void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func) { xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func), message); -- 2.20.1