Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for improving Windows networking compatibility. #8234

Merged
merged 2 commits into from Sep 10, 2022

Conversation

trivialfis
Copy link
Member

  • Include dmlc filesystem indirectly as dmlc/filesystem.h includes windows.h, which conflicts with winsock2.h
  • Define NOMINMAX conditionally.
  • Link the winsock library when mysys32 is used.
  • Add config file for read the doc.

Extracted from #8225 .

* Include dmlc filesystem indirectly as dmlc/filesystem.h includes windows.h, which
  conflicts with winsock2.h
* Define `NOMINMAX` conditionally.
* Link the winsock library when mysys32 is used.
* Add config file for read the doc.
Copy link
Collaborator

@hcho3 hcho3 left a comment

Choose a reason for hiding this comment

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

Let me submit a pull request to dmlc-core to hide all implementations details from the dmlc/filesystem.h header. For now, this PR looks fine.

/*!
* Copyright (c) 2022 by XGBoost Contributors
*/
#pragma once
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use include guard macros instead. CPPLint requires it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to using macro guard.

tests/cpp/filesystem.h Show resolved Hide resolved
@trivialfis
Copy link
Member Author

Let me submit a pull request to dmlc-core to hide all implementations details from the dmlc/filesystem.h header. For now, this PR looks fine.

Thank you! I'm not sure about the effect of that as I don't quite understand the internal of windows.h, so I tried to make this change local to XGBoost since it's only used in unittest.

@trivialfis
Copy link
Member Author

The error is a problem because we are using unity build on windows CI, so all files are exposed.

@trivialfis trivialfis merged commit bc81831 into dmlc:master Sep 10, 2022
@trivialfis trivialfis deleted the win-include branch September 10, 2022 07:16
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.

None yet

2 participants