diff options
author | Gergely Nagy <ngg@ngg.hu> | 2022-07-23 18:43:34 (GMT) |
---|---|---|
committer | Gergely Nagy <ngg@ngg.hu> | 2022-07-23 18:43:34 (GMT) |
commit | 87e50b0edde683e02673abc0de5fe162ff841349 (patch) | |
tree | 44e7ea08392ba6ae466135f38deaa6fd5a44cd49 /src/disk_interface.cc | |
parent | d4017a2b1ea642f12dabe05ec99b2a16c93e99aa (diff) | |
download | Ninja-87e50b0edde683e02673abc0de5fe162ff841349.zip Ninja-87e50b0edde683e02673abc0de5fe162ff841349.tar.gz Ninja-87e50b0edde683e02673abc0de5fe162ff841349.tar.bz2 |
Fix building on Windows in UNICODE mode
Diffstat (limited to 'src/disk_interface.cc')
-rw-r--r-- | src/disk_interface.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/disk_interface.cc b/src/disk_interface.cc index e73d901..e64bb43 100644 --- a/src/disk_interface.cc +++ b/src/disk_interface.cc @@ -267,7 +267,7 @@ FileReader::Status RealDiskInterface::ReadFile(const string& path, int RealDiskInterface::RemoveFile(const string& path) { #ifdef _WIN32 - DWORD attributes = GetFileAttributes(path.c_str()); + DWORD attributes = GetFileAttributesA(path.c_str()); if (attributes == INVALID_FILE_ATTRIBUTES) { DWORD win_err = GetLastError(); if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND) { @@ -278,7 +278,7 @@ int RealDiskInterface::RemoveFile(const string& path) { // On Windows Ninja should behave the same: // https://github.com/ninja-build/ninja/issues/1886 // Skip error checking. If this fails, accept whatever happens below. - SetFileAttributes(path.c_str(), attributes & ~FILE_ATTRIBUTE_READONLY); + SetFileAttributesA(path.c_str(), attributes & ~FILE_ATTRIBUTE_READONLY); } if (attributes & FILE_ATTRIBUTE_DIRECTORY) { // remove() deletes both files and directories. On Windows we have to @@ -286,7 +286,7 @@ int RealDiskInterface::RemoveFile(const string& path) { // used on a directory) // This fixes the behavior of ninja -t clean in some cases // https://github.com/ninja-build/ninja/issues/828 - if (!RemoveDirectory(path.c_str())) { + if (!RemoveDirectoryA(path.c_str())) { DWORD win_err = GetLastError(); if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND) { return 1; @@ -296,7 +296,7 @@ int RealDiskInterface::RemoveFile(const string& path) { return -1; } } else { - if (!DeleteFile(path.c_str())) { + if (!DeleteFileA(path.c_str())) { DWORD win_err = GetLastError(); if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND) { return 1; |