Commit dc938550 authored by Shoaib Meenai's avatar Shoaib Meenai Committed by Facebook Github Bot

Add preprocessor macro to disable throw* definitions

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
parent 815100a0
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
FOLLY_NAMESPACE_STD_BEGIN 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) { void __throw_length_error(const char* msg) {
throw std::length_error(msg); throw std::length_error(msg);
} }
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include <folly/Portability.h> #include <folly/Portability.h>
FOLLY_NAMESPACE_STD_BEGIN 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_length_error(const char* msg);
[[noreturn]] void __throw_logic_error(const char* msg); [[noreturn]] void __throw_logic_error(const char* msg);
[[noreturn]] void __throw_out_of_range(const char* msg); [[noreturn]] void __throw_out_of_range(const char* msg);
......
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