Commit 3c362348 authored by Andrew Gallagher's avatar Andrew Gallagher Committed by Facebook GitHub Bot

Always define `FOLLY_USE_LIBCPP` to `0`/`1`

Summary:
Users may set `FOLLY_USE_LIBCPP` or `FOLLY_USE_LIBSTDCPP` to `0` or
`1`, so make sure everything checks it via `#if`.

Reviewed By: luciang

Differential Revision: D32496561

fbshipit-source-id: 5eee660b540af0bf1eaee4949576acf11c9be8d0
parent d43c44b8
...@@ -220,7 +220,7 @@ constexpr bool kIsSanitize = false; ...@@ -220,7 +220,7 @@ constexpr bool kIsSanitize = false;
// It turns out that GNU libstdc++ and LLVM libc++ differ on how they implement // It turns out that GNU libstdc++ and LLVM libc++ differ on how they implement
// the 'std' namespace; the latter uses inline namespaces. Wrap this decision // the 'std' namespace; the latter uses inline namespaces. Wrap this decision
// up in a macro to make forward-declarations easier. // up in a macro to make forward-declarations easier.
#ifdef FOLLY_USE_LIBCPP #if FOLLY_USE_LIBCPP
#include <__config> // @manual #include <__config> // @manual
#define FOLLY_NAMESPACE_STD_BEGIN _LIBCPP_BEGIN_NAMESPACE_STD #define FOLLY_NAMESPACE_STD_BEGIN _LIBCPP_BEGIN_NAMESPACE_STD
#define FOLLY_NAMESPACE_STD_END _LIBCPP_END_NAMESPACE_STD #define FOLLY_NAMESPACE_STD_END _LIBCPP_END_NAMESPACE_STD
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// AtomicSharedPtr-detail.h only works with libstdc++, so skip these tests for // AtomicSharedPtr-detail.h only works with libstdc++, so skip these tests for
// other vendors // other vendors
#ifdef FOLLY_USE_LIBSTDCPP #if FOLLY_USE_LIBSTDCPP
#include <folly/concurrency/AtomicSharedPtr.h> #include <folly/concurrency/AtomicSharedPtr.h>
...@@ -236,10 +236,10 @@ int main(int, char**) { ...@@ -236,10 +236,10 @@ int main(int, char**) {
return 0; return 0;
} }
#else // #ifdef FOLLY_USE_LIBSTDCPP #else // #if FOLLY_USE_LIBSTDCPP
int main(int, char**) { int main(int, char**) {
return 1; return 1;
} }
#endif // #ifdef FOLLY_USE_LIBSTDCPP #endif // #if FOLLY_USE_LIBSTDCPP
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// AtomicSharedPtr-detail.h only works with libstdc++, so skip these tests for // AtomicSharedPtr-detail.h only works with libstdc++, so skip these tests for
// other vendors // other vendors
#ifdef FOLLY_USE_LIBSTDCPP #if FOLLY_USE_LIBSTDCPP
#include <folly/concurrency/test/AtomicSharedPtrCounted.h> #include <folly/concurrency/test/AtomicSharedPtrCounted.h>
...@@ -187,4 +187,4 @@ TEST(AtomicSharedPtr, DeterministicTest) { ...@@ -187,4 +187,4 @@ TEST(AtomicSharedPtr, DeterministicTest) {
DSched::join(t); DSched::join(t);
} }
} }
#endif // #ifdef FOLLY_USE_LIBSTDCPP #endif // #if FOLLY_USE_LIBSTDCPP
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// AtomicSharedPtr-detail.h only works with libstdc++, so skip these tests for // AtomicSharedPtr-detail.h only works with libstdc++, so skip these tests for
// other vendors // other vendors
#ifdef FOLLY_USE_LIBSTDCPP #if FOLLY_USE_LIBSTDCPP
#include <atomic> #include <atomic>
#include <memory> #include <memory>
...@@ -318,7 +318,7 @@ int main(int argc, char** argv) { ...@@ -318,7 +318,7 @@ int main(int argc, char** argv) {
return ret; return ret;
} }
#endif // #ifdef FOLLY_USE_LIBSTDCPP #endif // #if FOLLY_USE_LIBSTDCPP
#if 0 #if 0
// On Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz, 2 sockets, 28 cores, 56 threads. // On Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz, 2 sockets, 28 cores, 56 threads.
......
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