From e82d81a8843c1aa99b3d33f5478ac3b8ad127982 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 5 May 2017 22:04:28 +0100 Subject: [PATCH 1/2] Fix offset type to match the tables it is used in --- src/google/protobuf/generated_message_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index 44174466a..299d95b6b 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -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( \ + static_cast<::google::protobuf::uint32>( \ reinterpret_cast( \ &reinterpret_cast(16)->FIELD) - \ reinterpret_cast(16)) From e062f70c6d2e981686caa39e44701f7aaa6c66ed Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Sat, 6 May 2017 09:08:44 +0100 Subject: [PATCH 2/2] Fix compilation <: is a digraph, so a space is necessary for compilation on certain compilers. --- src/google/protobuf/generated_message_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index 299d95b6b..b9654ece5 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -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<::google::protobuf::uint32>( \ + static_cast< ::google::protobuf::uint32>( \ reinterpret_cast( \ &reinterpret_cast(16)->FIELD) - \ reinterpret_cast(16))