Fix build problem with -std=gnu++0x.

pull/3335/head
kenton@google.com 16 years ago
parent a5183461f8
commit f22943c7d0
  1. 3
      src/google/protobuf/generated_message_reflection.h

@ -347,7 +347,8 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection : public Reflection {
// choose 16 rather than some other number just in case the compiler would // choose 16 rather than some other number just in case the compiler would
// be confused by an unaligned pointer. // be confused by an unaligned pointer.
#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \ #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \
(reinterpret_cast<const char*>( \ static_cast<int>( \
reinterpret_cast<const char*>( \
&reinterpret_cast<const TYPE*>(16)->FIELD) - \ &reinterpret_cast<const TYPE*>(16)->FIELD) - \
reinterpret_cast<const char*>(16)) reinterpret_cast<const char*>(16))

Loading…
Cancel
Save