Skip to content

Commit ea0b69c

Browse files
committed
Fix mingw-w64 building
1 parent 3f44c80 commit ea0b69c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

httplib.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3078,8 +3078,13 @@ inline bool mmap::open(const char *path) {
30783078
auto wpath = u8string_to_wstring(path);
30793079
if (wpath.empty()) { return false; }
30803080

3081+
#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
30813082
hFile_ = ::CreateFile2(wpath.c_str(), GENERIC_READ, FILE_SHARE_READ,
30823083
OPEN_EXISTING, NULL);
3084+
#else
3085+
hFile_ = ::CreateFileW(wpath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL,
3086+
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3087+
#endif
30833088

30843089
if (hFile_ == INVALID_HANDLE_VALUE) { return false; }
30853090

0 commit comments

Comments
 (0)