From: Viktor Szakats Date: Fri, 11 Jul 2025 11:45:06 +0000 (+0200) Subject: lib: stop `time()` debug overrides at the end of source in altsvc, hsts X-Git-Tag: curl-8_15_0~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=886389dc01cd59b5718ba8f60f242c8094100c1c;p=thirdparty%2Fcurl.git 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 --- 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 */