summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Chou <schou@barracuda.com>2013-12-09 10:18:36 -0800
committerantirez <antirez@gmail.com>2014-08-08 10:46:57 +0200
commit7e9f24d6940f0edba71f15f8606e58045a84ead0 (patch)
tree505ae89cc6356ebd079a94f711603d819faf8c60
parenta8d3e930bced31cc0f5211cc0874ca6f837faca0 (diff)
downloadredis-7e9f24d6940f0edba71f15f8606e58045a84ead0.tar.gz
Improve accuracy of HAVE_ATOMIC dependency check
[I had to split out the clang check due to clang *really* not liking the __GLIBC_PREREQ macro; -matt] Closes #1456
-rw-r--r--src/config.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index 1bc70a13e..57d07599a 100644
--- a/src/config.h
+++ b/src/config.h
@@ -187,9 +187,14 @@ void setproctitle(const char *fmt, ...);
#if (__i386 || __amd64 || __powerpc__) && __GNUC__
#define GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-#if (GNUC_VERSION >= 40100) || defined(__clang__)
+#if defined(__clang__)
#define HAVE_ATOMIC
#endif
+#if (defined(__GLIBC__) && defined(__GLIBC_PREREQ))
+#if (GNUC_VERSION >= 40100 && __GLIBC_PREREQ(2, 6))
+#define HAVE_ATOMIC
+#endif
+#endif
#endif
#endif