From 56827ea52d1ca84715af7ceb0a3d339ba1d4e880 Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Mon, 23 Mar 2020 19:17:19 +0100 Subject: [PATCH] refs #58, compile error on MinGW --- .gitignore | 4 +++- include/ghc/filesystem.hpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d787f76..ba6a447 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -/build*/ +/*build*/ .vscode/ +.idea/ +*.swp diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index 7951369..1c6a270 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -4225,7 +4225,11 @@ GHC_INLINE void resize_file(const path& p, uintmax_t size, std::error_code& ec) LARGE_INTEGER lisize; lisize.QuadPart = static_cast(size); if(lisize.QuadPart < 0) { +#ifdef ERROR_FILE_TOO_LARGE ec = detail::make_system_error(ERROR_FILE_TOO_LARGE); +#else + ec = detail::make_system_error(223); +#endif return; } std::shared_ptr file(CreateFileW(detail::fromUtf8(p.u8string()).c_str(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL), CloseHandle);