aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrivehappy <drivehappy@gmail.com>2017-08-15 11:41:46 -0700
committerdrivehappy <drivehappy@gmail.com>2017-08-15 11:41:46 -0700
commita23e198ccaf53fededaa09b5988afece897fc3ac (patch)
treeebc0271c5c663ab0f90c5a2ad6102a85b654e0e0 /src
parente0d24cc84a81d236daf0bbf783037c8c8c24d814 (diff)
downloadprotobuf-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')
-rw-r--r--src/google/protobuf/stubs/port.h7
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