|
38 | 38 |
|
39 | 39 | #include "config.h" |
40 | 40 |
|
| 41 | +#include <sys/stat.h> |
| 42 | + |
41 | 43 | /* to have *_MAX definitions for all types when compiling with g++ */ |
42 | 44 | #define __STDC_LIMIT_MACROS |
43 | 45 |
|
@@ -124,19 +126,19 @@ typedef char bool; |
124 | 126 | #endif |
125 | 127 |
|
126 | 128 |
|
127 | | -#if defined(HAVE__FSEEKI64) && defined(HAVE__FSTAT64) && defined(HAVE__SEEK64) |
| 129 | +#if defined(HAVE__FSEEKI64) && defined(HAVE__FSTAT64) && defined(HAVE__FTELLI64) |
128 | 130 | /* Windows API using int64 */ |
129 | 131 | typedef zip_int64_t zip_off_t; |
130 | 132 | typedef struct _stat64 zip_os_stat_t; |
131 | 133 | #define zip_os_stat _stat64 |
132 | 134 | #define zip_os_fstat _fstat64 |
133 | | -#define zip_os_seek _fseeki64 |
| 135 | +#define zip_os_fseek _fseeki64 |
| 136 | +#define zip_os_ftell _ftelli64 |
134 | 137 | #define ZIP_FSEEK_MAX ZIP_INT64_MAX |
135 | 138 | #define ZIP_FSEEK_MIN ZIP_INT64_MIN |
136 | 139 | #else |
137 | 140 |
|
138 | 141 | /* Normal API */ |
139 | | -#include <sys/stat.h> |
140 | 142 | typedef struct stat zip_os_stat_t; |
141 | 143 | #define zip_os_fstat fstat |
142 | 144 | #define zip_os_stat stat |
@@ -222,10 +224,10 @@ typedef long zip_off_t; |
222 | 224 |
|
223 | 225 | #ifndef HAVE_STRERROR_S |
224 | 226 | #define strerrorlen_s(errnum) (strlen(strerror(errnum))) |
225 | | -#define strerror_s(buf, bufsz, errnum) ((void)strncpy_s((buf), (bufsz), strerror(errnum), (bufsz)), (buf)[(bufsz)-1] = '\0', strerrorlen_s(errnum) >= (bufsz)) |
| 227 | +#define strerror_s(buf, bufsz, errnum) ((void)strncpy_s((buf), (bufsz), strerror(errnum), (bufsz)), (buf)[(bufsz) - 1] = '\0', strerrorlen_s(errnum) >= (bufsz)) |
226 | 228 | #else |
227 | 229 | #ifndef HAVE_STRERRORLEN_S |
228 | | -#define strerrorlen_s(errnum) 8192 |
| 230 | +#define strerrorlen_s(errnum) 8192 |
229 | 231 | #endif |
230 | 232 | #endif |
231 | 233 |
|
@@ -259,11 +261,11 @@ typedef long zip_off_t; |
259 | 261 | #endif |
260 | 262 |
|
261 | 263 | #ifndef S_ISDIR |
262 | | -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) |
| 264 | +#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) |
263 | 265 | #endif |
264 | 266 |
|
265 | 267 | #ifndef S_ISREG |
266 | | -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) |
| 268 | +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) |
267 | 269 | #endif |
268 | 270 |
|
269 | 271 | #endif /* compat.h */ |
0 commit comments