curl/lib/curlx
Viktor Szakats c6988f9131
curlx: move Curl_gmtime(), use gmtime_s() on Windows
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 54d9f060b4
Closes #19955
2025-12-16 14:30:05 +01:00
..
base64.c tidy-up: avoid (()), clang-format fixes and more 2025-12-05 16:07:03 +01:00
base64.h curlx_base64_encode: use uint8_t* for input 2025-11-27 14:35:01 +01:00
binmode.h lib: make CURLX_SET_BINMODE() and use it 2025-06-19 15:57:37 +02:00
curlx.h curlx: limit use of system allocators to the minimum possible 2025-12-05 15:32:59 +01:00
dynbuf.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
dynbuf.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
fopen.c windows: assume USE_WIN32_LARGE_FILES 2025-12-09 19:34:13 +01:00
fopen.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
inet_ntop.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
inet_ntop.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
inet_pton.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
inet_pton.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
multibyte.c curlx: limit use of system allocators to the minimum possible 2025-12-05 15:32:59 +01:00
multibyte.h tidy-up: avoid (()), clang-format fixes and more 2025-12-05 16:07:03 +01:00
nonblock.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
nonblock.h curlx: move nonblock.[ch] into curlx/ 2025-05-08 13:22:02 +02:00
snprintf.h curlx: replace sprintf with snprintf 2025-11-25 11:11:06 +01:00
strerr.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
strerr.h curlx: move Curl_strerror, use in src and tests, ban strerror globally 2025-10-06 09:44:23 +02:00
strparse.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
strparse.h tidy-up: avoid (()), clang-format fixes and more 2025-12-05 16:07:03 +01:00
timediff.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
timediff.h curlx: move into to curlx/ 2025-05-07 11:01:15 +02:00
timeval.c curlx: move Curl_gmtime(), use gmtime_s() on Windows 2025-12-16 14:30:05 +01:00
timeval.h curlx: move Curl_gmtime(), use gmtime_s() on Windows 2025-12-16 14:30:05 +01:00
version_win32.c build: stop overriding standard memory allocation functions 2025-11-28 10:44:26 +01:00
version_win32.h curlx: move version_win32.[ch] to curlx/ 2025-05-08 17:09:32 +02:00
wait.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
wait.h lib: make curlx_wait_ms() and use it 2025-06-19 15:57:37 +02:00
warnless.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
warnless.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
winapi.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
winapi.h windows: use native error code types more 2025-10-06 12:12:44 +02:00