Summary:
- libc++ uses inline namespaces in its implementation of the std
namespace; use its macros for our forward-declaring needs.
@override-unit-failures
The hphp_packedtv test has been sitting postponed for a long time. I
can't repro its failure locally anyway.
Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac
Reviewed By: simpkins@fb.com
FB internal diff:
D998578
# define FOLLY_DISABLE_ADDRESS_SANITIZER
#endif
+// It turns out that GNU libstdc++ and LLVM libc++ differ on how they implement
+// the 'std' namespace; the latter uses inline namepsaces. Wrap this decision
+// up in a macro to make forward-declarations easier.
+#ifdef _LIBCPP_VERSION
+#define FOLLY_NAMESPACE_STD_BEGIN _LIBCPP_BEGIN_NAMESPACE_STD
+#define FOLLY_NAMESPACE_STD_END _LIBCPP_END_NAMESPACE_STD
+#else
+#define FOLLY_NAMESPACE_STD_BEGIN namespace std {
+#define FOLLY_NAMESPACE_STD_END }
+#endif
+
#endif // FOLLY_PORTABILITY_H_
#include <limits>
#include <type_traits>
+#include "folly/Portability.h"
+
#include <bits/c++config.h>
#include <boost/type_traits.hpp>
* although that is not guaranteed by the standard.
*/
-namespace std {
+FOLLY_NAMESPACE_STD_BEGIN
template <class T, class U>
struct pair;
template <class T>
class shared_ptr;
-}
+FOLLY_NAMESPACE_STD_END
namespace boost {