Commit 10530c34 by Ehsan Akhgari Committed by Jamie Madill

Add ANGLE_NO_EXCEPTIONS macro

This macro allows us to hide angle's usage of try/catch so that we can properly hide them from compilers that do not support exceptions properly (such as clang-cl and gcc/clang with -fno-exceptions). Change-Id: I75f466a5322e5840e007711ea851f444bd6ca299 Reviewed-on: https://chromium-review.googlesource.com/206562Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: <ehsan@mozilla.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent c1cc4c46
...@@ -21,6 +21,17 @@ ...@@ -21,6 +21,17 @@
TypeName(const TypeName&); \ TypeName(const TypeName&); \
void operator=(const TypeName&) void operator=(const TypeName&)
// Macros for writing try catch blocks. Defining ANGLE_NO_EXCEPTIONS
// when building angle will disable the usage of try/catch for compilers
// without proper support for them (such as clang-cl).
#ifdef ANGLE_NO_EXCEPTIONS
#define ANGLE_TRY if (true)
#define ANGLE_CATCH_ALL else
#else
#define ANGLE_TRY try
#define ANGLE_CATCH_ALL catch(...)
#endif
template <typename T, unsigned int N> template <typename T, unsigned int N>
inline unsigned int ArraySize(T(&)[N]) inline unsigned int ArraySize(T(&)[N])
{ {
......
Markdown is supported
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