From: Marko Novakovic Date: Fri, 25 Aug 2017 22:23:42 +0000 (-0700) Subject: Added a flag FOLLY_FORCE_EXCEPTION_COUNT_USE_STD X-Git-Tag: v2017.08.28.00~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=04a42b09207e3266bd1a9c3414024c4132845fd6;p=folly.git Added a flag FOLLY_FORCE_EXCEPTION_COUNT_USE_STD Summary: The flag FOLLY_FORCE_EXCEPTION_COUNT_USE_STD forces the usage of std:uncaught_exceptions() for folly's implementation of uncaught_exceptions() Reviewed By: yfeldblum Differential Revision: D5542302 fbshipit-source-id: 2c2f507ab9dde916a160a9c370a267cdcfd7203a --- diff --git a/folly/UncaughtExceptions.h b/folly/UncaughtExceptions.h index b9dd5fae..0c2a6336 100644 --- a/folly/UncaughtExceptions.h +++ b/folly/UncaughtExceptions.h @@ -18,7 +18,8 @@ #include -#if defined(__GNUG__) || defined(__clang__) +#if !defined(FOLLY_FORCE_EXCEPTION_COUNT_USE_STD) && \ + (defined(__GNUG__) || defined(__clang__)) #define FOLLY_EXCEPTION_COUNT_USE_CXA_GET_GLOBALS namespace __cxxabiv1 { // forward declaration (originally defined in unwind-cxx.h from from libstdc++) @@ -32,7 +33,8 @@ extern "C" __cxa_eh_globals* __cxa_get_globals() noexcept; // forward declaration (originally defined in mtdll.h from MSVCRT) struct _tiddata; extern "C" _tiddata* _getptd(); // declared in mtdll.h from MSVCRT -#elif defined(_MSC_VER) && (_MSC_VER >= 1900) // MSVC++ 2015 +#elif defined(FOLLY_FORCE_EXCEPTION_COUNT_USE_STD) || \ + (defined(_MSC_VER) && (_MSC_VER >= 1900)) // MSVC++ 2015 #define FOLLY_EXCEPTION_COUNT_USE_STD #else // Raise an error when trying to use this on unsupported platforms.