diff --git a/include/filter_utils.h b/include/filter_utils.h index 49a883a7d..df1970be4 100644 --- a/include/filter_utils.h +++ b/include/filter_utils.h @@ -74,6 +74,7 @@ DISKANN_DLLEXPORT tsl::robin_map> generate_la * Each data file is saved under the following format: * input_data_path + "_" + label */ +#ifndef _WINDOWS template inline tsl::robin_map> generate_label_specific_vector_files( path input_data_path, tsl::robin_map labels_to_number_of_points, @@ -181,6 +182,7 @@ inline tsl::robin_map> generate_label_specifi return label_id_to_orig_id; #endif } +#endif inline std::vector loadTags(const std::string &tags_file, const std::string &base_file) { diff --git a/src/windows_aligned_file_reader.cpp b/src/windows_aligned_file_reader.cpp index 9b1a024bd..3650b928a 100644 --- a/src/windows_aligned_file_reader.cpp +++ b/src/windows_aligned_file_reader.cpp @@ -6,6 +6,7 @@ #include "windows_aligned_file_reader.h" #include #include "utils.h" +#include #define SECTOR_LEN 4096 @@ -43,9 +44,17 @@ void WindowsAlignedFileReader::register_thread() FILE_ATTRIBUTE_READONLY | FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED | FILE_FLAG_RANDOM_ACCESS, NULL); if (ctx.fhandle == INVALID_HANDLE_VALUE) { - std::stringstream ss; - ss << m_filename.c_str(); - diskann::cout << "Error opening " << ss.str() << " -- error=" << GetLastError() << std::endl; + const size_t c_max_filepath_len = 256; + size_t actual_len = 0; + char filePath[c_max_filepath_len]; + if (wcstombs_s(&actual_len, filePath, c_max_filepath_len, m_filename.c_str(), m_filename.length()) == 0) + { + diskann::cout << "Error opening " << filePath << " -- error=" << GetLastError() << std::endl; + } + else + { + diskann::cout << "Error converting wchar to char -- error=" << GetLastError() << std::endl; + } } // create IOCompletionPort