From f22943c7d0ce19b35a1e3d7f33c8ede3b6fed485 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Mon, 1 Jun 2009 18:27:23 +0000 Subject: Fix build problem with -std=gnu++0x. --- src/google/protobuf/generated_message_reflection.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h index 44231c6b..66f8c474 100644 --- a/src/google/protobuf/generated_message_reflection.h +++ b/src/google/protobuf/generated_message_reflection.h @@ -347,9 +347,10 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection : public Reflection { // choose 16 rather than some other number just in case the compiler would // be confused by an unaligned pointer. #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \ - (reinterpret_cast( \ - &reinterpret_cast(16)->FIELD) - \ - reinterpret_cast(16)) + static_cast( \ + reinterpret_cast( \ + &reinterpret_cast(16)->FIELD) - \ + reinterpret_cast(16)) // There are some places in proto2 where dynamic_cast would be useful as an // optimization. For example, take Message::MergeFrom(const Message& other). -- cgit v1.2.3