Summary:
libc++ 3.9 and above define the __throw* functions inside stdexcept, so
defining them ourselves leads to compilation errors when compiling
against libc++ 3.9. Add appropriate preprocessor guards to avoid this.
Reviewed By: meyering
Differential Revision:
D3898284
fbshipit-source-id:
435a28c2b3a83ee4d8f5af0df0343c524469011e
FOLLY_NAMESPACE_STD_BEGIN
+#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3900
void __throw_length_error(const char* msg) {
throw std::length_error(msg);
}
void __throw_out_of_range(const char* msg) {
throw std::out_of_range(msg);
}
+#endif
#ifdef _MSC_VER
void __throw_bad_alloc() {
#include <folly/Portability.h>
FOLLY_NAMESPACE_STD_BEGIN
+#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3900
[[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);
+#endif
#ifdef _MSC_VER
[[noreturn]] void __throw_bad_alloc();