Skip to content

Commit

Permalink
index.hpp: fix build with UNICODE defined
Browse files Browse the repository at this point in the history
Be explicit that we want CreateFileA here, as CreateFile will fail with
an error about conversion from `const char *` to `LPCWSTR` when
`UNICODE` is defined.
  • Loading branch information
cebtenzzre committed Jun 25, 2024
1 parent 5ea48c8 commit 22cfa3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/usearch/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ class memory_mapped_file_t {
#if defined(USEARCH_DEFINED_WINDOWS)

HANDLE file_handle =
CreateFile(path_, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
CreateFileA(path_, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (file_handle == INVALID_HANDLE_VALUE)
return result.failed("Opening file failed!");

Expand Down

0 comments on commit 22cfa3b

Please sign in to comment.