Summary:
libc++ 4.0 and above define the throw* functions in `stdexcept`, so
Folly doesn't need to define them itself. In case those definitions are
backported to 3.9, add a Folly macro to skip the definitions regardless
of the libc++ version number.
Reviewed By: yfeldblum, Orvid
Differential Revision:
D4378102
fbshipit-source-id:
674d98d7c448aa7e75bdd8b6e9fe965cd34a83d7
FOLLY_NAMESPACE_STD_BEGIN
-#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3900
+#if (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3900) && \
+ !defined(FOLLY_SKIP_LIBCPP_4000_THROW_BACKPORTS)
void __throw_length_error(const char* msg) {
throw std::length_error(msg);
}
#include <folly/Portability.h>
FOLLY_NAMESPACE_STD_BEGIN
-#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3900
+#if (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3900) && \
+ !defined(FOLLY_SKIP_LIBCPP_4000_THROW_BACKPORTS)
[[noreturn]] void __throw_length_error(const char* msg);
[[noreturn]] void __throw_logic_error(const char* msg);
[[noreturn]] void __throw_out_of_range(const char* msg);