Merge pull request #3064 from randomguy3/offset-type

Fix offset type macro to match the tables it is used in
This commit is contained in:
Feng Xiao 2017-05-08 11:56:18 -07:00 committed by GitHub
commit d22493b6f6

View File

@ -100,7 +100,7 @@ namespace internal {
// 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) \
static_cast<int>( \
static_cast< ::google::protobuf::uint32>( \
reinterpret_cast<const char*>( \
&reinterpret_cast<const TYPE*>(16)->FIELD) - \
reinterpret_cast<const char*>(16))