]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/MINOR: ancient gcc versions atomic fix
authorDavid Carlier <devnexen@gmail.com>
Thu, 11 Jan 2018 14:20:43 +0000 (14:20 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jan 2018 14:31:07 +0000 (15:31 +0100)
Commit 1a69af6d3892fe1946bb8babb3044d2d26afd46e introduced code
for atomic prior to 4.7. Unfortunately clang uses as well those
constants which is misleading.

include/common/hathreads.h

index 503abbec3185806b2ee51a17f49ba513a6f11dc3..5f0b9695445dc07bfa2e39bd9f6d94a6b08ad2f2 100644 (file)
@@ -100,7 +100,7 @@ extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the threa
 /* TODO: thread: For now, we rely on GCC builtins but it could be a good idea to
  * have a header file regrouping all functions dealing with threads. */
 
-#if defined(__GNUC__) && (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 7)
+#if defined(__GNUC__) && (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 7) && !defined(__clang__)
 /* gcc < 4.7 */
 
 #define HA_ATOMIC_ADD(val, i)        __sync_add_and_fetch(val, i)