Skip to content

build: drop detecting gettimeofday() on Windows - #22594

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:w-drop-gettimeofday
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:w-drop-gettimeofday

Conversation

@vszakats

@vszakats vszakats commented Aug 15, 2026

Copy link
Copy Markdown
Member

To remove a build difference between mingw-w64 and MSVC builds (where
mingw-w64 has it, while MSVC does not). Also to simplify and save the
cost of detection/verification in CI.

gettimeofday() was used in curl_threads.c in codepath practically
unreachable in Windows builds, and in tool_writeout.c that falls back
to time() for targets without it.

Ref: #22593


$ wine curl.exe -w '%time{%m/%d/%y}' https://curl.se/ --out-null

@vszakats vszakats added build Windows Windows-specific labels Aug 15, 2026
@vszakats
vszakats requested a balanced review from Copilot August 15, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Limits gettimeofday() detection to non-Windows targets, aligning MinGW and MSVC builds.

Changes:

  • Removes Windows-specific feature definitions.
  • Restricts Autoconf and CMake detection to non-Windows platforms.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
lib/config-win32.h Removes the MinGW definition.
configure.ac Moves detection into the non-Windows block.
CMakeLists.txt Restricts detection to non-Windows targets.
CMake/win32-cache.cmake Removes cached Windows defaults.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakeLists.txt

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

To remove a build difference between mingw-w64 and MSVC builds, simplify
and save the cost of detection/verification in CI.

`gettimeofday()` was used in `curl_threads.c` in codepath practically
unreachable in Windows builds, and in `tool_writeout.c` that was a
fallback to `time()` for targets without it.

Ref: curl#22593
@vszakats
vszakats force-pushed the w-drop-gettimeofday branch from 410d142 to 1bf852e Compare August 16, 2026 10:22
@vszakats vszakats closed this in 4b42956 Aug 16, 2026
@vszakats
vszakats deleted the w-drop-gettimeofday branch August 16, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants