Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
b271d5c8
Commit
b271d5c8
authored
Aug 30, 2016
by
Davis King
Browse files
workaround bugs in visual studio
parent
758068da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dlib/assert.h
dlib/assert.h
+4
-2
No files found.
dlib/assert.h
View file @
b271d5c8
...
...
@@ -148,13 +148,15 @@ namespace dlib
throw dlib::fatal_error(dlib::EBROKEN_ASSERT,dlib_o_out.str()); \
}}
// This macro is not needed if you have a real C++ compiler. It's here to work around bugs in Visual Studio's preprocessor.
#define DLIB_WORKAROUND_VISUAL_STUDIO_BUGS(x) x
// Make it so the 2nd argument of DLIB_CASSERT is optional. That is, you can call it like
// DLIB_CASSERT(exp) or DLIB_CASSERT(exp,message).
#define DLIBM_CASSERT_1_ARGS(exp) DLIBM_CASSERT(exp,"")
#define DLIBM_CASSERT_2_ARGS(exp,message) DLIBM_CASSERT(exp,message)
#define DLIBM_GET_3TH_ARG(arg1, arg2, arg3, ...) arg3
#define DLIBM_CASSERT_CHOOSER(...) DLIBM_GET_3TH_ARG(__VA_ARGS__, DLIBM_CASSERT_2_ARGS, DLIBM_CASSERT_1_ARGS)
#define DLIB_CASSERT(...) DLIBM_CASSERT_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
#define DLIBM_CASSERT_CHOOSER(...)
DLIB_WORKAROUND_VISUAL_STUDIO_BUGS(
DLIBM_GET_3TH_ARG(__VA_ARGS__, DLIBM_CASSERT_2_ARGS, DLIBM_CASSERT_1_ARGS)
)
#define DLIB_CASSERT(...)
DLIB_WORKAROUND_VISUAL_STUDIO_BUGS(
DLIBM_CASSERT_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
)
#ifdef ENABLE_ASSERTS
...
...
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