From 886389dc01cd59b5718ba8f60f242c8094100c1c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 11 Jul 2025 13:45:06 +0200 Subject: [PATCH] lib: stop `time()` debug overrides at the end of source in altsvc, hsts To avoid applying it to all other sources in unity mode. This may have affected tests setting a custom time via `CURL_TIME`, in unity builds: 446, 780, 781, 782, 783, 970, 972, 1654, 1660 Closes #17897 --- lib/altsvc.c | 4 ++++ lib/hsts.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/altsvc.c b/lib/altsvc.c index bd87af1c87..2ccd22ef47 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -665,4 +665,8 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, return FALSE; } +#if defined(DEBUGBUILD) || defined(UNITTESTS) +#undef time +#endif + #endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */ diff --git a/lib/hsts.c b/lib/hsts.c index cba218153a..91f32276f9 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -580,4 +580,8 @@ void Curl_hsts_loadfiles(struct Curl_easy *data) } } +#if defined(DEBUGBUILD) || defined(UNITTESTS) +#undef time +#endif + #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */ -- 2.47.3