From 6f7a11481f9d5c43964d105d5da23be832deec03 Mon Sep 17 00:00:00 2001 From: Mohamed Amin JABRI Date: Wed, 6 Jul 2016 14:23:51 -0700 Subject: [PATCH] Remove extra ';' from used macros in Traits.h Summary: Using folly on OSX using gcc-5.3 causes errors due to extra ';' in macro expansion in Traits.h. Closes https://github.com/facebook/folly/pull/394 Reviewed By: yfeldblum Differential Revision: D3205265 Pulled By: elliottneilclark fbshipit-source-id: f49ab04add382660719b3bb83bce3c8dc303db8b --- folly/Traits.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/folly/Traits.h b/folly/Traits.h index 39136a72..6ea1c4b1 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -90,16 +90,15 @@ namespace folly { namespace traits_detail { -#define FOLLY_HAS_TRUE_XXX(name) \ - BOOST_MPL_HAS_XXX_TRAIT_DEF(name); \ - template struct name ## _is_true \ - : std::is_same {}; \ - template struct has_true_ ## name \ - : std::conditional< \ - has_ ## name ::value, \ - name ## _is_true, \ - std::false_type \ - >:: type {}; +#define FOLLY_HAS_TRUE_XXX(name) \ + BOOST_MPL_HAS_XXX_TRAIT_DEF(name) \ + template \ + struct name##_is_true : std::is_same {}; \ + template \ + struct has_true_##name : std::conditional< \ + has_##name::value, \ + name##_is_true, \ + std::false_type>::type {}; FOLLY_HAS_TRUE_XXX(IsRelocatable) FOLLY_HAS_TRUE_XXX(IsZeroInitializable) @@ -410,17 +409,17 @@ constexpr construct_in_place_t construct_in_place{}; // gcc-5.0 changed string's implementation in libgcc to be non-relocatable #if __GNUC__ < 5 -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::basic_string); +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::basic_string) #endif -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::vector); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::list); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::deque); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::unique_ptr); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::shared_ptr); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::function); +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::vector) +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::list) +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::deque) +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::unique_ptr) +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::shared_ptr) +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::function) // Boost -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(boost::shared_ptr); +FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(boost::shared_ptr) #define FOLLY_CREATE_HAS_MEMBER_TYPE_TRAITS(classname, type_name) \ template \ -- 2.34.1