mirror of
https://github.com/curl/curl.git
synced 2026-05-14 07:46:20 +03:00
Move `Curl_gmtime()` to curlx and rename to `curlx_gmtime()`. Then call
the internal wrapper also from the curl tool, to avoid using the banned
`gmtime()` directly, and using better, thread-safe alternatives when
available.
Windows `gmtime_s()` requires mingw-w64 v4+ or MSVC. Use local
workaround to also support mingw-w64 v3. `gmtime_s()` also makes
defining `_CRT_SECURE_NO_WARNINGS` unnecessary.
Also:
- lib: drop unused `parsedate.h` includes.
- drop redundant cast from `gmtime_r()` result.
- autotools: reverse condition in the proto detection to avoid
misleading readers. (the condition plays no role in detection.)
- note Windows XP's default `msvcrt.dll` doesn't offer secure CRT APIs.
XP likely needs a newer version of this DLL, or may not run.
Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-gmtime32-gmtime64
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-s-gmtime32-s-gmtime64-s
https://pubs.opengroup.org/onlinepubs/9799919799/functions/gmtime.html
https://linux.die.net/man/3/gmtime_r
Ref: #19957 (for `localtime_r()`)
Follow-up to
|
||
|---|---|---|
| .. | ||
| base64.c | ||
| base64.h | ||
| binmode.h | ||
| curlx.h | ||
| dynbuf.c | ||
| dynbuf.h | ||
| fopen.c | ||
| fopen.h | ||
| inet_ntop.c | ||
| inet_ntop.h | ||
| inet_pton.c | ||
| inet_pton.h | ||
| multibyte.c | ||
| multibyte.h | ||
| nonblock.c | ||
| nonblock.h | ||
| snprintf.h | ||
| strerr.c | ||
| strerr.h | ||
| strparse.c | ||
| strparse.h | ||
| timediff.c | ||
| timediff.h | ||
| timeval.c | ||
| timeval.h | ||
| version_win32.c | ||
| version_win32.h | ||
| wait.c | ||
| wait.h | ||
| warnless.c | ||
| warnless.h | ||
| winapi.c | ||
| winapi.h | ||