Skip to content

Fix mingw warnings.#11859

Merged
trivialfis merged 1 commit into
dmlc:masterfrom
trivialfis:fix-mingw-warning
Dec 12, 2025
Merged

Fix mingw warnings.#11859
trivialfis merged 1 commit into
dmlc:masterfrom
trivialfis:fix-mingw-warning

Conversation

@trivialfis

Copy link
Copy Markdown
Member

Close #11851 .

@trivialfis
trivialfis requested review from Copilot and hcho3 and removed request for Copilot December 11, 2025 12:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes MinGW-specific warnings related to socket handling by ensuring proper cross-platform socket error checking and header inclusion patterns.

  • Updated socket error check to use INVALID_SOCKET instead of hardcoded -1
  • Modified _WINSOCKAPI_ macro definition to avoid conflicts with MinGW's header handling

Reviewed changes

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

File Description
src/collective/tracker.cc Changed socket creation error check from -1 to INVALID_SOCKET for proper cross-platform compatibility
include/xgboost/windefs.h Added MinGW-specific condition to prevent defining _WINSOCKAPI_ which conflicts with MinGW's internal header management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trivialfis trivialfis mentioned this pull request Dec 11, 2025
10 tasks
@trivialfis
trivialfis merged commit 90baad2 into dmlc:master Dec 12, 2025
71 checks passed
@trivialfis
trivialfis deleted the fix-mingw-warning branch December 12, 2025 08:20
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation warning about winsock2.h

3 participants