Add GOOGLE_ATTRIBUTE_NOINLINE to GetArena() and GetMaybeArenaPointer() methods. This is to avoid "unresolved link" errors in MSVC 2015 during Release build

pull/813/head
0xAAE 9 years ago
parent fbabf987e6
commit d41a3d630c
  1. 8
      src/google/protobuf/message.cc

@ -495,11 +495,19 @@ Message* GenericTypeHandler<Message>::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<Message>::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<Message>::GetMaybeArenaPointer(
Message* value) {
return value->GetMaybeArenaPointer();

Loading…
Cancel
Save