Make C++ unit tests run and pass on Windows (#3869)
* Make C++ unit tests run and pass on Windows * Fix logic for external memory. The letter ':' is part of drive letter, so remove the drive letter before splitting on ':'. * Cosmetic syntax changes to keep MSVC happy. * Fix lint * Add Windows guard
This commit is contained in:
committed by
GitHub
parent
d9642cf757
commit
2b045aa805
@@ -5,12 +5,12 @@
|
||||
#include "xgboost/c_api.h"
|
||||
#include <random>
|
||||
|
||||
bool FileExists(const std::string name) {
|
||||
bool FileExists(const std::string& filename) {
|
||||
struct stat st;
|
||||
return stat(name.c_str(), &st) == 0;
|
||||
return stat(filename.c_str(), &st) == 0;
|
||||
}
|
||||
|
||||
long GetFileSize(const std::string filename) {
|
||||
long GetFileSize(const std::string& filename) {
|
||||
struct stat st;
|
||||
stat(filename.c_str(), &st);
|
||||
return st.st_size;
|
||||
|
||||
Reference in New Issue
Block a user