Skip to content

Commit

Permalink
Merge pull request #50 from nightlark/fix-conversion-warning-32bit-ta…
Browse files Browse the repository at this point in the history
…rget

Static cast to fix conversion error on 32-bit processors
  • Loading branch information
gulrak committed Mar 4, 2020
2 parents 21b1fb9 + 94738c9 commit 1d85ec3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3961,8 +3961,8 @@ GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::err
struct ::timespec times[2];
times[0].tv_sec = 0;
times[0].tv_nsec = UTIME_OMIT;
times[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
times[1].tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000;
times[1].tv_sec = static_cast<decltype(times[1].tv_sec)>(std::chrono::duration_cast<std::chrono::seconds>(d).count());
times[1].tv_nsec = static_cast<decltype(times[1].tv_nsec)>(std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000);
if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
ec = detail::make_system_error();
}
Expand Down

0 comments on commit 1d85ec3

Please sign in to comment.