Commit 231b7c5a authored by Marc Horowitz's avatar Marc Horowitz Committed by Sara Golemon

make folly/detail/FunctionalExcept.* work if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set or not

Summary: When doing android development, we need to compile with
FOLLY_HAVE_BITS_FUNCTEXCEPT_H set for some flavors, and
FOLLY_HAVE_BITS_FUNCTEXCEPT_H unset for others (primarily for tests
run in the local (xcode) development platform).  This diff adds some
more conditionals so it all works.

In this repro, these files are never used, so this is more or less a
noop, but this is the upstream so I'm making these changes here.

Reviewed By: @Gownta

Differential Revision: D2202107
parent a09c094f
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Portability.h>
// If FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set, this file compiles to
// nothing.
#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
#include <folly/detail/FunctionalExcept.h> #include <folly/detail/FunctionalExcept.h>
#include <stdexcept> #include <stdexcept>
...@@ -39,3 +46,5 @@ void __throw_bad_alloc() { ...@@ -39,3 +46,5 @@ void __throw_bad_alloc() {
#endif #endif
FOLLY_NAMESPACE_STD_END FOLLY_NAMESPACE_STD_END
#endif
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
FOLLY_NAMESPACE_STD_BEGIN FOLLY_NAMESPACE_STD_BEGIN
FOLLY_NORETURN void __throw_length_error(const char* msg); FOLLY_NORETURN void __throw_length_error(const char* msg);
...@@ -31,4 +33,8 @@ FOLLY_NORETURN void __throw_bad_alloc(); ...@@ -31,4 +33,8 @@ FOLLY_NORETURN void __throw_bad_alloc();
FOLLY_NAMESPACE_STD_END FOLLY_NAMESPACE_STD_END
#else
#error This file should never be included if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set
#endif
#endif #endif
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