Fixed compilation under MSYS2.

This commit is contained in:
Alexander Shaduri
2021-03-04 14:35:05 +04:00
parent 53a3f73156
commit 1d5e8822e6
+2 -2
View File
@@ -112,7 +112,7 @@ std::map<char, DriveLetterInfo> win32_get_drive_letter_map()
for (char c = 'A'; c <= 'Z'; ++c) {
if (drives[c - 'A']) { // drive is present
debug_out_dump("app", "Windows drive found: " << c << ".\n");
if (GetDriveType((c + string(":\\")).c_str()) == DRIVE_FIXED) {
if (GetDriveType((c + std::string(":\\")).c_str()) == DRIVE_FIXED) {
debug_out_dump("app", "Windows drive " << c << " is fixed.\n");
good_drives.push_back(c);
}
@@ -121,7 +121,7 @@ std::map<char, DriveLetterInfo> win32_get_drive_letter_map()
// Try to open each drive, check its disk extents
for (char drive : good_drives) {
string drive_str = string("\\\\.\\") + drive + ":";
std::string drive_str = std::string("\\\\.\\") + drive + ":";
HANDLE h = CreateFileA(
drive_str.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr,
OPEN_EXISTING, FILE_FLAG_NO_BUFFERING | FILE_FLAG_RANDOM_ACCESS, nullptr);