Commit f22943c7 authored by kenton@google.com's avatar kenton@google.com

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

parent a5183461
...@@ -347,9 +347,10 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection : public Reflection { ...@@ -347,9 +347,10 @@ 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 TYPE*>(16)->FIELD) - \ reinterpret_cast<const char*>( \
reinterpret_cast<const char*>(16)) &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 // There are some places in proto2 where dynamic_cast would be useful as an
// optimization. For example, take Message::MergeFrom(const Message& other). // optimization. For example, take Message::MergeFrom(const Message& other).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment