Include cpp only when needed
authorSathya Gunasekar <sathya@fb.com>
Tue, 15 Oct 2013 02:50:20 +0000 (19:50 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 24 Oct 2013 21:53:41 +0000 (14:53 -0700)
Summary:
D1008921 broke compilation for tao which uses folly/Portability.h
This diff guards the change for only c++ code. Not sure if this breaks the
definition of portability.

Test Plan: Compile tao, fbconfig -r folly and fbmake runtests

Reviewed By: simpkins@fb.com

FB internal diff: D1010967

@override-unit-failures

folly/Portability.h

index 47d33be4a5a690babb58f82c1b3dbcee2535a89c..6d5ab9c938793b04d640862328fa986b59324cf6 100644 (file)
@@ -137,6 +137,7 @@ struct MaxAlign { char c; } __attribute__((aligned));
 #include "folly/detail/Clock.h"
 #endif
 
+#if defined(__cplusplus)
 // Unfortunately, boost::has_trivial_copy<T> is broken in libc++ due to its
 // usage of __has_trivial_copy(), so we can't use it as a
 // least-common-denominator for C++11 implementations that don't support
@@ -153,5 +154,6 @@ struct MaxAlign { char c; } __attribute__((aligned));
 #include <boost/type_traits.hpp>
 #define FOLLY_IS_TRIVIALLY_COPYABLE(T)      (boost::has_trivial_copy<T>::value)
 #endif
+#endif // __cplusplus
 
 #endif // FOLLY_PORTABILITY_H_