From f6f5f2443acc1f0c64fde7d62256cc8152a12cc4 Mon Sep 17 00:00:00 2001 From: Samuel Chou Date: Mon, 9 Dec 2013 10:18:36 -0800 Subject: [PATCH] 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 --- src/config.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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