From 64ff6a9948c01c914e0f8e09ca636c8ca01c4d25 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 12 Aug 2025 09:33:12 +0200 Subject: [PATCH] error on inability to use ALARMs just a check on our CI platforms --- lib/easy_lock.h | 3 ++- lib/hostip.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/easy_lock.h b/lib/easy_lock.h index 909753f43a..ff8e51a1bf 100644 --- a/lib/easy_lock.h +++ b/lib/easy_lock.h @@ -37,6 +37,7 @@ #define curl_simple_lock_unlock(m) ReleaseSRWLockExclusive(m) #elif defined(HAVE_ATOMIC) && defined(HAVE_STDATOMIC_H) + #include #ifdef HAVE_SCHED_YIELD #include @@ -61,7 +62,7 @@ #define HAVE_BUILTIN_IA32_PAUSE #endif -#endif +#endif /* !__INTEL_COMPILER */ static CURL_INLINE void curl_simple_lock_lock(curl_simple_lock *lock) { diff --git a/lib/hostip.c b/lib/hostip.c index 74ed5c0277..66b6ba038d 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -78,6 +78,26 @@ #define USE_ALARM_TIMEOUT #endif +#ifndef USE_ALARM_TIMEOUT +#ifndef CURLRES_SYNCH +/* disabling USE_ALARM_TIMEOUT because we are not using + the SYNCH resolver is fine */ +#endif +#ifndef HAVE_ALARM +#error "USE_ALARM_TIMEOUT disabled, HAVE_ALARM not defined" +#endif +#ifndef SIGALRM +#error "USE_ALARM_TIMEOUT disabled, SIGALRM not defined" +#endif +#ifndef HAVE_SIGSETJMP +#error "USE_ALARM_TIMEOUT disabled, HAVE_SIGSETJMP not defined" +#endif +#ifndef GLOBAL_INIT_IS_THREADSAFE +#error "USE_ALARM_TIMEOUT disabled, GLOBAL_INIT_IS_THREADSAFE not defined" +#endif +#endif /* !USE_ALARM_TIMEOUT */ + + #define MAX_HOSTCACHE_LEN (255 + 7) /* max FQDN + colon + port number + zero */ #define MAX_DNS_CACHE_SIZE 29999