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

This commit is contained in:
kenton@google.com 2009-06-01 18:27:23 +00:00
parent a5183461f8
commit f22943c7d0

View File

@ -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).