diff --git a/port/win/env_win.cc b/port/win/env_win.cc index 1e6e9d65b..6bd28751e 100644 --- a/port/win/env_win.cc +++ b/port/win/env_win.cc @@ -684,7 +684,8 @@ IOStatus WinFileSystem::GetChildren(const std::string& dir, // which appear only on some platforms const bool ignore = ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) && - (strcmp(data.cFileName, ".") == 0 || strcmp(data.cFileName, "..") == 0); + (RX_FNCMP(data.cFileName, ".") == 0 || + RX_FNCMP(data.cFileName, "..") == 0); if (!ignore) { auto x = RX_FILESTRING(data.cFileName, RX_FNLEN(data.cFileName)); result->push_back(FN_TO_RX(x)); diff --git a/port/win/port_win.h b/port/win/port_win.h index 2da6314e1..a6a6de278 100644 --- a/port/win/port_win.h +++ b/port/win/port_win.h @@ -355,6 +355,7 @@ extern void SetCpuPriority(ThreadId id, CpuPriority priority); #define RX_FILESTRING std::wstring #define RX_FN(a) ROCKSDB_NAMESPACE::port::utf8_to_utf16(a) #define FN_TO_RX(a) ROCKSDB_NAMESPACE::port::utf16_to_utf8(a) +#define RX_FNCMP(a, b) ::wcscmp(a, RX_FN(b).c_str()) #define RX_FNLEN(a) ::wcslen(a) #define RX_DeleteFile DeleteFileW @@ -379,6 +380,7 @@ extern void SetCpuPriority(ThreadId id, CpuPriority priority); #define RX_FILESTRING std::string #define RX_FN(a) a #define FN_TO_RX(a) a +#define RX_FNCMP(a, b) strcmp(a, b) #define RX_FNLEN(a) strlen(a) #define RX_DeleteFile DeleteFileA