From 4a78b42b591b115f6881232d9c3ea0a4eb935664 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Tue, 15 Nov 2016 17:30:09 -0800 Subject: [PATCH] Don't assume standard library types are relocatable Summary: Although currently the only one of these that isn't relocatable is `std::string`, making assumptions about the standard library is a terrible idea, so disable all of them. Reviewed By: yfeldblum Differential Revision: D4186024 fbshipit-source-id: 4d2a54d232df0cb05959a8d9cb1a2d2cf34d1302 --- folly/Traits.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/folly/Traits.h b/folly/Traits.h index ece58c30..a78f6e05 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -578,6 +578,8 @@ constexpr initlist_construct_t initlist_construct{}; } // namespace folly +// Assume nothing when compiling with MSVC. +#ifndef _MSC_VER // gcc-5.0 changed string's implementation in libgcc to be non-relocatable #if __GNUC__ < 5 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::basic_string) @@ -591,6 +593,7 @@ FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::function) // Boost FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(boost::shared_ptr) +#endif #define FOLLY_CREATE_HAS_MEMBER_TYPE_TRAITS(classname, type_name) \ template \ -- 2.34.1