Commit 5ca1a1f2 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libdatrwxx [WP]: support multi-line abort message

parent ae04d551
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
* - move report functions to separate compilation unit * - move report functions to separate compilation unit
* - create multiline messages * - create multiline messages
* - remove specific multiline macros * - remove specific multiline macros
* - 11/07/2016 V1.8 thof:
* - support multi-line abort message
* *
* ============================================================================ * ============================================================================
*/ */
...@@ -84,20 +86,28 @@ ...@@ -84,20 +86,28 @@
* *
* \ingroup group_error * \ingroup group_error
* \param C assert condition * \param C assert condition
* \param M message of type char* * \param M message (may use output operators;
* possibly containing newline characters)
*/ */
#define DATRW_assert(C,M) DATRW_Xassert( C , M , datrw::Exception ) #define DATRW_assert(C,M) DATRW_Xassert( C , M , datrw::Exception )
/*! \brief Abort and give a message. /*! \brief Abort and give a message.
* *
* \ingroup group_error * \ingroup group_error
* \param M message of type char* * \param M message (may use output operators;
* possibly containing newline characters)
* \param E exception class to throw * \param E exception class to throw
*/ */
#define DATRW_abort(M) \ #define DATRW_abort(M) \
throw( datrw::Exception ( M , __FILE__, __LINE__ )) { \
std::ostringstream oss; \
oss << M; \
throw( datrw::Exception ( oss.str() , __FILE__, __LINE__ )); \
}
#define DATRW_illegal DATRW_abort("illegal call!") #define DATRW_illegal DATRW_abort("Illegal call within the library!\n" \
"This must be considered a bug. Please report the issue at\n" \
"https://git.scc.kit.edu/Seitosh/Seitosh")
/*! \brief Check an assertion and report only. /*! \brief Check an assertion and report only.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment