From dc76fb147b35fe0db8ef6ccca12f6bab3eeec15a Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Mon, 21 Dec 2020 20:08:57 -0500 Subject: [PATCH] Attempt to fix large file support on Windows --- src/readstat.h | 2 +- src/readstat_io_unistd.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/readstat.h b/src/readstat.h index ece0d379..c9aa8250 100644 --- a/src/readstat.h +++ b/src/readstat.h @@ -298,7 +298,7 @@ typedef int (*readstat_progress_handler)(double progress, void *ctx); #if defined(_MSC_VER) #include typedef SSIZE_T ssize_t; -typedef _off_t readstat_off_t; +typedef __int64 readstat_off_t; #elif defined _WIN32 || defined __CYGWIN__ typedef _off64_t readstat_off_t; #elif defined _AIX diff --git a/src/readstat_io_unistd.c b/src/readstat_io_unistd.c index 35602911..d3adbf92 100644 --- a/src/readstat_io_unistd.c +++ b/src/readstat_io_unistd.c @@ -7,6 +7,7 @@ #endif #if defined _WIN32 # include +# include #endif #include "readstat.h" @@ -20,10 +21,9 @@ #define UNISTD_OPEN_OPTIONS O_RDONLY #endif -#if defined _MSC_VER && defined WIN64 +#if defined _WIN32 #define lseek _lseeki64 -#elif defined _MSC_VER -#elif defined _WIN32 || defined _AIX +#elif defined _AIX #define lseek lseek64 #endif