X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FUncaughtExceptions.h;h=0b90f62099b0e0af8e7333b43ade7568e31b0a79;hb=baa03294ee862eb532108797267dc72497afaa16;hp=e45c52dff73d5a7fc183bd6fa058d88d51e1d904;hpb=1e03974395c7007e75ed7847ad7d28b36a1c3a1b;p=folly.git diff --git a/folly/UncaughtExceptions.h b/folly/UncaughtExceptions.h index e45c52df..0b90f620 100644 --- a/folly/UncaughtExceptions.h +++ b/folly/UncaughtExceptions.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,21 +18,23 @@ #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++) struct __cxa_eh_globals; // declared in cxxabi.h from libstdc++-v3 extern "C" __cxa_eh_globals* __cxa_get_globals() noexcept; -} +} // namespace __cxxabiv1 #elif defined(_MSC_VER) && (_MSC_VER >= 1400) && \ (_MSC_VER < 1900) // MSVC++ 8.0 or greater #define FOLLY_EXCEPTION_COUNT_USE_GETPTD // 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. @@ -63,4 +65,4 @@ inline int uncaught_exceptions() noexcept { #endif } -} // namespaces +} // namespace folly