Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
1d6a1d79
Verified
Commit
1d6a1d79
authored
Oct 18, 2019
by
Justin Carpentier
Browse files
macros: allow to disable throwing if needed
parent
75044afe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/macros.hpp
View file @
1d6a1d79
...
...
@@ -27,9 +27,13 @@
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#endif
/// \brief Generic macro to throw a en exception in Pinocchio with a given input message.
#define PINOCCHIO_THROW(condition,exception_type,message) \
if (!(condition)) { throw exception_type(PINOCCHIO_STRING_LITERAL(message)); }
/// \brief Generic macro to throw an exception in Pinocchio if the condition is not met with a given input message.
#if !defined(PINOCCHIO_NO_THROW)
#define PINOCCHIO_THROW(condition,exception_type,message) \
if (!(condition)) { throw exception_type(PINOCCHIO_STRING_LITERAL(message)); }
#else
#define PINOCCHIO_THROW(condition,exception_type,message)
#endif
#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_INPUT_ARGUMENT(_1, _2, MACRO_NAME, ...) MACRO_NAME
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment