void-packages/srcpkgs/atomicparsley/patches/musl-fpos_t.patch

31 lines
1.1 KiB
Diff
Raw Normal View History

--- AtomicParsley.cpp 2017-01-27 18:09:38.871046030 +0100
+++ AtomicParsley.cpp 2017-01-27 18:10:35.548088839 +0100
@@ -4585,10 +4585,11 @@
#if defined(_MSC_VER)
fpos_t file_offset = dest_position + file_pos;
#elif defined(__GLIBC__)
- fpos_t file_offset = {0};
+ fpos_t file_offset = {0};
file_offset.__pos = dest_position + file_pos;
#else
- off_t file_offset = dest_position + file_pos;
+ fpos_t file_offset = {0};
+ *(uint64_t*) &file_offset = dest_position + file_pos;
#endif
fsetpos(dest_file, &file_offset);
fwrite(buffer, (size_t)max_buffer, 1, dest_file);
@@ -4601,10 +4601,11 @@
#if defined(_MSC_VER)
fpos_t file_offset = dest_position + file_pos;
#elif defined(__GLIBC__)
- fpos_t file_offset = {0};
+ fpos_t file_offset = {0};
file_offset.__pos = dest_position + file_pos;
#else
- off_t file_offset = dest_position + file_pos;
+ fpos_t file_offset = {0};
+ *(uint64_t*) &file_offset = dest_position + file_pos;
#endif
fsetpos(dest_file, &file_offset );
fwrite(buffer, (size_t)(src_file_size - file_pos), 1, dest_file);