diff options
author | drivehappy <drivehappy@gmail.com> | 2017-08-15 11:41:46 -0700 |
---|---|---|
committer | drivehappy <drivehappy@gmail.com> | 2017-08-15 11:41:46 -0700 |
commit | a23e198ccaf53fededaa09b5988afece897fc3ac (patch) | |
tree | ebc0271c5c663ab0f90c5a2ad6102a85b654e0e0 /src/google | |
parent | e0d24cc84a81d236daf0bbf783037c8c8c24d814 (diff) | |
download | protobuf-a23e198ccaf53fededaa09b5988afece897fc3ac.tar.gz protobuf-a23e198ccaf53fededaa09b5988afece897fc3ac.tar.bz2 protobuf-a23e198ccaf53fededaa09b5988afece897fc3ac.zip |
Fixing warning under Clang 6.x (-Wexpansion-to-defined) where the macro expansion producing 'defined' was warning on undefined behavior.
Diffstat (limited to 'src/google')
-rw-r--r-- | src/google/protobuf/stubs/port.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 7879aed4..83eaf31e 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -256,8 +256,11 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF); # define GOOGLE_PROTOBUF_USE_UNALIGNED 0 #else // x86 and x86-64 can perform unaligned loads/stores directly. -# define GOOGLE_PROTOBUF_USE_UNALIGNED defined(_M_X64) || \ - defined(__x86_64__) || defined(_M_IX86) || defined(__i386__) +# if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__) +# define GOOGLE_PROTOBUF_USE_UNALIGNED 1 +# else +# define GOOGLE_PROTOBUF_USE_UNALIGNED 0 +# endif #endif #if GOOGLE_PROTOBUF_USE_UNALIGNED |