Merge pull request #2476 from acozzette/generated-message-reflection-fix
Use uint32 in GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET macro
This commit is contained in:
commit
84948462a4
1 changed files with 4 additions and 4 deletions
|
@ -660,14 +660,14 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection PROTOBUF_FINAL : public Refl
|
||||||
// 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) \
|
||||||
static_cast<int>( \
|
static_cast< ::google::protobuf::uint32>( \
|
||||||
reinterpret_cast<const char*>( \
|
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))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ONEOF, FIELD) \
|
#define PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ONEOF, FIELD) \
|
||||||
static_cast< ::google::protobuf::uint32>( \
|
static_cast< ::google::protobuf::uint32>( \
|
||||||
reinterpret_cast<const char*>(&(ONEOF->FIELD)) \
|
reinterpret_cast<const char*>(&(ONEOF->FIELD)) \
|
||||||
- reinterpret_cast<const char*>(ONEOF))
|
- reinterpret_cast<const char*>(ONEOF))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue