summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAbhishek Parmar <abhishek@orng.net>2015-04-08 17:19:06 (GMT)
committerAbhishek Parmar <abhishek@orng.net>2015-04-08 17:19:06 (GMT)
commit701dd7120dd0a4e3f5d5c01c4431695ae6306aa2 (patch)
tree9eac6bb89ca22b9585e208b76849a2bd02577a64 /src
parent1b0b08c8dda1659027677966b03a3ff3c488e549 (diff)
downloadglog-701dd7120dd0a4e3f5d5c01c4431695ae6306aa2.zip
glog-701dd7120dd0a4e3f5d5c01c4431695ae6306aa2.tar.gz
glog-701dd7120dd0a4e3f5d5c01c4431695ae6306aa2.tar.bz2
Guard GOOGLE_PREDICT_TRUE|FALS with #ifndef to avoid collision with other google opensource projects like protobuf.
Diffstat (limited to 'src')
-rw-r--r--src/glog/logging.h.in21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in
index affe0c5..b4229d0 100644
--- a/src/glog/logging.h.in
+++ b/src/glog/logging.h.in
@@ -129,15 +129,28 @@ typedef unsigned __int64 uint64;
#ifndef GOOGLE_PREDICT_BRANCH_NOT_TAKEN
#if @ac_cv_have___builtin_expect@
#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) (__builtin_expect(x, 0))
-#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))
-#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
#else
#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x
+#endif
+#endif
+
+#ifndef GOOGLE_PREDICT_FALSE
+#if @ac_cv_have___builtin_expect@
+#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))
+#else
#define GOOGLE_PREDICT_FALSE(x) x
+#endif
+#endif
+
+#ifndef GOOGLE_PREDICT_TRUE
+#if @ac_cv_have___builtin_expect@
+#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
+#else
#define GOOGLE_PREDICT_TRUE(x) x
#endif
#endif
+
// Make a bunch of macros for logging. The way to log things is to stream
// things to LOG(<a particular severity level>). E.g.,
//
@@ -710,10 +723,10 @@ DEFINE_CHECK_OP_IMPL(Check_GT, > )
// to reduce the overhead of CHECK statments by 2x.
// Real DCHECK-heavy tests have seen 1.5x speedups.
-// The meaning of "string" might be different between now and
+// The meaning of "string" might be different between now and
// when this macro gets invoked (e.g., if someone is experimenting
// with other string implementations that get defined after this
-// file is included). Save the current meaning now and use it
+// file is included). Save the current meaning now and use it
// in the macro.
typedef std::string _Check_string;
#define CHECK_OP_LOG(name, op, val1, val2, log) \