make folly/detail/FunctionalExcept.* work if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set...
authorMarc Horowitz <mhorowitz@fb.com>
Tue, 30 Jun 2015 19:39:50 +0000 (12:39 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 1 Jul 2015 23:24:51 +0000 (16:24 -0700)
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

folly/detail/FunctionalExcept.cpp
folly/detail/FunctionalExcept.h

index 2d9cc88..b0427cf 100644 (file)
  * 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 <stdexcept>
@@ -39,3 +46,5 @@ void __throw_bad_alloc() {
 #endif
 
 FOLLY_NAMESPACE_STD_END
+
+#endif
index ec3446a..a041378 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <folly/Portability.h>
 
+#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