Skip to content

Commit 8da2510

Browse files
committed
Fix warning when compiling with Boost.Iostreams for Windows
1 parent c2a6930 commit 8da2510

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io/nativefilestream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ NativeFileStream::FileBuffer::FileBuffer(const char *path, ios_base::openmode op
194194
#ifdef PLATFORM_WINDOWS
195195
handle = CreateFileW(widePath.get(), nativeParams.access, nativeParams.shareMode, nullptr, nativeParams.creation, FILE_ATTRIBUTE_NORMAL, nullptr);
196196
if (handle == INVALID_HANDLE_VALUE) {
197-
throw std::ios_base::failure("CreateFileW failed", std::error_code(GetLastError(), std::system_category()));
197+
throw std::ios_base::failure("CreateFileW failed", std::error_code(static_cast<int>(GetLastError()), std::system_category()));
198198
}
199199
buffer = make_unique<StreamBuffer>(handle, boost::iostreams::close_handle);
200200
// if we wanted to open assign the descriptor as well: descriptor = _open_osfhandle(reinterpret_cast<intptr_t>(handle), nativeParams.flags);

0 commit comments

Comments
 (0)