Prepare for improving Windows networking compatibility. (#8234)

* Prepare for improving Windows networking compatibility.

* 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.
This commit is contained in:
Jiaming Yuan
2022-09-10 15:16:49 +08:00
committed by GitHub
parent dd44ac91b8
commit bc818316f2
35 changed files with 173 additions and 106 deletions

15
tests/cpp/filesystem.h Normal file
View File

@@ -0,0 +1,15 @@
/*!
* Copyright (c) 2022 by XGBoost Contributors
*/
#ifndef XGBOOST_TESTS_CPP_FILESYSTEM_H
#define XGBOOST_TESTS_CPP_FILESYSTEM_H
// A macro used inside `windows.h` to avoid conflicts with `winsock2.h`
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif // WIN32_LEAN_AND_MEAN
#include "dmlc/filesystem.h"
#endif // XGBOOST_TESTS_CPP_FILESYSTEM_H