aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/generated_message_reflection.h
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-06-01 18:27:23 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-06-01 18:27:23 +0000
commitf22943c7d0ce19b35a1e3d7f33c8ede3b6fed485 (patch)
treebe27bd7bcf830d172a8f32ebaa56c611882329a1 /src/google/protobuf/generated_message_reflection.h
parenta5183461f8c81a51d58bf85e5168d5c2ea86ad1d (diff)
downloadprotobuf-f22943c7d0ce19b35a1e3d7f33c8ede3b6fed485.tar.gz
protobuf-f22943c7d0ce19b35a1e3d7f33c8ede3b6fed485.tar.bz2
protobuf-f22943c7d0ce19b35a1e3d7f33c8ede3b6fed485.zip
Fix build problem with -std=gnu++0x.
Diffstat (limited to 'src/google/protobuf/generated_message_reflection.h')
-rw-r--r--src/google/protobuf/generated_message_reflection.h7
1 files changed, 4 insertions, 3 deletions
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<const char*>( \
- &reinterpret_cast<const TYPE*>(16)->FIELD) - \
- reinterpret_cast<const char*>(16))
+ static_cast<int>( \
+ reinterpret_cast<const char*>( \
+ &reinterpret_cast<const TYPE*>(16)->FIELD) - \
+ reinterpret_cast<const char*>(16))
// There are some places in proto2 where dynamic_cast would be useful as an
// optimization. For example, take Message::MergeFrom(const Message& other).