Skip to content

Commit

Permalink
Also add cast for lseek in unix branch
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Dec 3, 2023
1 parent df6c2a4 commit bf61abd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/osmium/util/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ namespace osmium {
* @param fd Open file descriptor.
* @param offset Desired absolute offset into the file
*/
inline void file_seek(int fd, size_t offset) noexcept {
inline void file_seek(int fd, std::size_t offset) noexcept {
#ifdef _MSC_VER
osmium::detail::disable_invalid_parameter_handler diph;
// https://msdn.microsoft.com/en-us/library/1yee101t.aspx
_lseeki64(fd, static_cast<__int64>(offset), SEEK_SET);
#else
::lseek(fd, offset, SEEK_SET);
::lseek(fd, static_cast<off_t>(offset), SEEK_SET);
#endif
}

Expand Down

0 comments on commit bf61abd

Please sign in to comment.