From d41a3d630c529c61a1a01ba95867965744b4cc12 Mon Sep 17 00:00:00 2001 From: 0xAAE Date: Tue, 15 Sep 2015 01:46:28 +0300 Subject: [PATCH] Add GOOGLE_ATTRIBUTE_NOINLINE to GetArena() and GetMaybeArenaPointer() methods. This is to avoid "unresolved link" errors in MSVC 2015 during Release build --- src/google/protobuf/message.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index 2f6416d0f3..9a58678348 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -495,11 +495,19 @@ Message* GenericTypeHandler::NewFromPrototype( return prototype->New(arena); } template<> +#if defined(_MSC_VER) && (_MSC_VER >= 1900) +// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240 +GOOGLE_ATTRIBUTE_NOINLINE +#endif google::protobuf::Arena* GenericTypeHandler::GetArena( Message* value) { return value->GetArena(); } template<> +#if defined(_MSC_VER) && (_MSC_VER >= 1900) +// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240 +GOOGLE_ATTRIBUTE_NOINLINE +#endif void* GenericTypeHandler::GetMaybeArenaPointer( Message* value) { return value->GetMaybeArenaPointer();