comparison Framework/StoneException.h @ 851:101073b3e855

Added namespace to ORTHANC_ASSERT macros
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 17 Jun 2019 16:13:14 +0200
parents 07adcffba38c
children 1091b2adeb5a
comparison
equal deleted inserted replaced
850:df0c73ee7afa 851:101073b3e855
126 #define ORTHANC_ASSERT1(cond) \ 126 #define ORTHANC_ASSERT1(cond) \
127 if (!(cond)) { \ 127 if (!(cond)) { \
128 std::stringstream sst; \ 128 std::stringstream sst; \
129 sst << "Assertion failed. Condition = \"" #cond "\""; \ 129 sst << "Assertion failed. Condition = \"" #cond "\""; \
130 std::string sstr = sst.str(); \ 130 std::string sstr = sst.str(); \
131 throw OrthancException(ErrorCode_InternalError,sstr.c_str()); \ 131 throw ::Orthanc::OrthancException(::Orthanc::ErrorCode_InternalError,sstr.c_str()); \
132 } else (void)0 132 } else (void)0
133
134
135 133
136 # define ORTHANC_EXPAND( x ) x 134 # define ORTHANC_EXPAND( x ) x
137 # define GET_ORTHANC_ASSERT(_1,_2,NAME,...) NAME 135 # define GET_ORTHANC_ASSERT(_1,_2,NAME,...) NAME
138 # define ORTHANC_ASSERT(...) ORTHANC_EXPAND(GET_ORTHANC_ASSERT(__VA_ARGS__, ORTHANC_ASSERT2, ORTHANC_ASSERT1, UNUSED)(__VA_ARGS__)) 136 # define ORTHANC_ASSERT(...) ORTHANC_EXPAND(GET_ORTHANC_ASSERT(__VA_ARGS__, ORTHANC_ASSERT2, ORTHANC_ASSERT1, UNUSED)(__VA_ARGS__))
139 137