]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easy_lock: fix build with icc
authorDaniel Stenberg <daniel@haxx.se>
Tue, 12 Jul 2022 13:57:02 +0000 (15:57 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 12 Jul 2022 21:08:35 +0000 (23:08 +0200)
The Intel compiler tries to look like GCC *and* clang *and* it lies in
its __has_builtin() function (returns true when it should return false),
so override it.

Reported-by: Matthew Thompson
Fixes #9081
Closes #9144

lib/easy_lock.h

index 808610f8e5c5225406811a55834fad2ee4733095..4c22be5f8aac09b5eff5029fde13eb33509eb8d3 100644 (file)
@@ -61,6 +61,10 @@ typedef PVOID SRWLOCK, *PSRWLOCK;
 #define __has_builtin(x) 0
 #endif
 
+#ifndef __INTEL_COMPILER
+/* The Intel compiler tries to look like GCC *and* clang *and* lies in its
+   __has_builtin() function, so override it. */
+
 /* if GCC on i386/x86_64 or if the built-in is present */
 #if ( (defined(__GNUC__) && !defined(__clang__)) &&     \
       (defined(__i386__) || defined(__x86_64__))) ||    \
@@ -68,6 +72,8 @@ typedef PVOID SRWLOCK, *PSRWLOCK;
 #define HAVE_BUILTIN_IA32_PAUSE
 #endif
 
+#endif
+
 static inline void curl_simple_lock_lock(curl_simple_lock *lock)
 {
   for(;;) {