diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2023-09-05 22:42:10 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2023-09-22 20:00:38 +0300 |
commit | 79334e7f20f2bf9e0de095835b48868f1238f584 (patch) | |
tree | fb1182bb184b9cf9baa0701c54438e540e87fa28 /src/xz/file_io.h | |
parent | MSVC: xz: Use GetTickCount64() to implement mytime_now(). (diff) | |
download | xz-79334e7f20f2bf9e0de095835b48868f1238f584.tar.xz |
MSVC: xz: Make file_io.c and file_io.h compatible with MSVC.
Thanks to Kelvin Lee for the original patches
and testing the modifications I made.
Diffstat (limited to 'src/xz/file_io.h')
-rw-r--r-- | src/xz/file_io.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xz/file_io.h b/src/xz/file_io.h index 6992efa4..906fd960 100644 --- a/src/xz/file_io.h +++ b/src/xz/file_io.h @@ -18,6 +18,16 @@ # define IO_BUFFER_SIZE (BUFSIZ & ~7U) #endif +#ifdef _MSC_VER + // The first one renames both "struct stat" -> "struct _stat64" + // and stat() -> _stat64(). The documentation mentions only + // "struct __stat64", not "struct _stat64", but the latter + // works too. +# define stat _stat64 +# define fstat _fstat64 +# define off_t __int64 +#endif + /// is_sparse() accesses the buffer as uint64_t for maximum speed. /// The u32 and u64 members must only be access through this union |