Browse Source

Fixed bug in GOOGLE_PREDICT_FALSE.

The GOOGLE_PREDICT_FALSE macro is both incorrect, and doesn't match
the macro definition in glog, which causes conflicts when including
both libraries.  This commit fixes that by making it identical to
what is in glog.
Austin Schuh 10 years ago
parent
commit
f4c8627edb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/google/protobuf/stubs/common.h

+ 1 - 1
src/google/protobuf/stubs/common.h

@@ -258,7 +258,7 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);
 #ifndef GOOGLE_PREDICT_FALSE
 #ifndef GOOGLE_PREDICT_FALSE
 #ifdef __GNUC__
 #ifdef __GNUC__
 // Provided at least since GCC 3.0.
 // Provided at least since GCC 3.0.
-#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(!!(x), 1))
+#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))
 #else
 #else
 #define GOOGLE_PREDICT_FALSE
 #define GOOGLE_PREDICT_FALSE
 #endif
 #endif