From: Marc Horowitz Date: Tue, 30 Jun 2015 19:39:50 +0000 (-0700) Subject: make folly/detail/FunctionalExcept.* work if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set... X-Git-Tag: v0.49.0~20 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=231b7c5a6bebf2afdc25075f8a0d2158a6893dd8;ds=sidebyside 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 --- diff --git a/folly/detail/FunctionalExcept.cpp b/folly/detail/FunctionalExcept.cpp index 2d9cc88b..b0427cf9 100644 --- a/folly/detail/FunctionalExcept.cpp +++ b/folly/detail/FunctionalExcept.cpp @@ -14,6 +14,13 @@ * limitations under the License. */ +#include + +// If FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set, this file compiles to +// nothing. + +#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H + #include #include @@ -39,3 +46,5 @@ void __throw_bad_alloc() { #endif FOLLY_NAMESPACE_STD_END + +#endif diff --git a/folly/detail/FunctionalExcept.h b/folly/detail/FunctionalExcept.h index ec3446ad..a041378e 100644 --- a/folly/detail/FunctionalExcept.h +++ b/folly/detail/FunctionalExcept.h @@ -19,6 +19,8 @@ #include +#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H + FOLLY_NAMESPACE_STD_BEGIN FOLLY_NORETURN void __throw_length_error(const char* msg); @@ -31,4 +33,8 @@ FOLLY_NORETURN void __throw_bad_alloc(); FOLLY_NAMESPACE_STD_END +#else +#error This file should never be included if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set +#endif + #endif