Function parseAssert() showed only that an error occurred.
A macro instead shows also the error condition and line number.
Change-Id: Ibd686286c58b657fd578f92bd4328072aa892933
bool ignore_always{false};
};
-void parseAssert(bool condition) {
- assert(condition);
- if (!condition) {
- throw std::runtime_error("Parsing error");
- }
+#define parseAssert(cond) \
+{ \
+ assert(cond); \
+ if (!(cond)) { \
+ throw std::runtime_error("Parsing error"); \
+ } \
}
void start_element_handler(void *data, const char *el, const char **attr) {