From: Michihiro NAKAJIMA Date: Tue, 23 Feb 2010 18:10:33 +0000 (-0500) Subject: Avoid failing some libarchive_test on Windows and some platforms, X-Git-Tag: v3.0.0a~1199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f64286f4d8622af87da35f2f972c13d640dd68cf;p=thirdparty%2Flibarchive.git Avoid failing some libarchive_test on Windows and some platforms, whose the size of off_t is four bytes. SVN-Revision: 1966 --- diff --git a/libarchive/archive_read_open_fd.c b/libarchive/archive_read_open_fd.c index 6ebeb71f0..65735b274 100644 --- a/libarchive/archive_read_open_fd.c +++ b/libarchive/archive_read_open_fd.c @@ -59,7 +59,11 @@ struct read_fd_data { static int file_close(struct archive *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t file_skip(struct archive *, void *, off_t request); +#else +static int64_t file_skip(struct archive *, void *, int64_t request); +#endif int archive_read_open_fd(struct archive *a, int fd, size_t block_size) @@ -119,8 +123,13 @@ file_read(struct archive *a, void *client_data, const void **buff) return (bytes_read); } +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t file_skip(struct archive *a, void *client_data, off_t request) +#else +static int64_t +file_skip(struct archive *a, void *client_data, int64_t request) +#endif { struct read_fd_data *mine = (struct read_fd_data *)client_data; off_t old_offset, new_offset; diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c index a0b519b87..b7bf9ca11 100644 --- a/libarchive/archive_read_open_file.c +++ b/libarchive/archive_read_open_file.c @@ -59,7 +59,11 @@ struct read_FILE_data { static int file_close(struct archive *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t file_skip(struct archive *, void *, off_t request); +#else +static int64_t file_skip(struct archive *, void *, int64_t request); +#endif int archive_read_open_FILE(struct archive *a, FILE *f) @@ -115,8 +119,13 @@ file_read(struct archive *a, void *client_data, const void **buff) return (bytes_read); } +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t file_skip(struct archive *a, void *client_data, off_t request) +#else +static int64_t +file_skip(struct archive *a, void *client_data, int64_t request) +#endif { struct read_FILE_data *mine = (struct read_FILE_data *)client_data; diff --git a/libarchive/archive_read_open_filename.c b/libarchive/archive_read_open_filename.c index 9cac80e62..bed5e3318 100644 --- a/libarchive/archive_read_open_filename.c +++ b/libarchive/archive_read_open_filename.c @@ -76,7 +76,11 @@ struct read_file_data { static int file_close(struct archive *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t file_skip(struct archive *, void *, off_t request); +#else +static int64_t file_skip(struct archive *, void *, int64_t request); +#endif static off_t file_skip_lseek(struct archive *, void *, off_t request); int @@ -297,8 +301,13 @@ file_skip_lseek(struct archive *a, void *client_data, off_t request) * accelerate operation on tape drives. */ +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t file_skip(struct archive *a, void *client_data, off_t request) +#else +static int64_t +file_skip(struct archive *a, void *client_data, int64_t request) +#endif { struct read_file_data *mine = (struct read_file_data *)client_data; diff --git a/libarchive/archive_read_open_memory.c b/libarchive/archive_read_open_memory.c index b52d9be53..559781fe1 100644 --- a/libarchive/archive_read_open_memory.c +++ b/libarchive/archive_read_open_memory.c @@ -48,7 +48,11 @@ struct read_memory_data { static int memory_read_close(struct archive *, void *); static int memory_read_open(struct archive *, void *); +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t memory_read_skip(struct archive *, void *, off_t request); +#else +static int64_t memory_read_skip(struct archive *, void *, int64_t request); +#endif static ssize_t memory_read(struct archive *, void *, const void **buff); int @@ -119,8 +123,13 @@ memory_read(struct archive *a, void *client_data, const void **buff) * necessary in order to better exercise internal code when used * as a test harness. */ +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t memory_read_skip(struct archive *a, void *client_data, off_t skip) +#else +static int64_t +memory_read_skip(struct archive *a, void *client_data, int64_t skip) +#endif { struct read_memory_data *mine = (struct read_memory_data *)client_data; diff --git a/libarchive/test/read_open_memory.c b/libarchive/test/read_open_memory.c index e4e911c2f..68d78b12d 100644 --- a/libarchive/test/read_open_memory.c +++ b/libarchive/test/read_open_memory.c @@ -49,7 +49,11 @@ struct read_memory_data { static int memory_read_close(struct archive *, void *); static int memory_read_open(struct archive *, void *); +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t memory_read_skip(struct archive *, void *, off_t request); +#else +static int64_t memory_read_skip(struct archive *, void *, int64_t request); +#endif static ssize_t memory_read(struct archive *, void *, const void **buff); static int read_open_memory_internal(struct archive *a, void *buff, size_t size, size_t read_size, int fullapi); @@ -137,8 +141,13 @@ memory_read(struct archive *a, void *client_data, const void **buff) /* * How mean can a skip() routine be? Let's try to find out. */ +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t memory_read_skip(struct archive *a, void *client_data, off_t skip) +#else +static int64_t +memory_read_skip(struct archive *a, void *client_data, int64_t skip) +#endif { struct read_memory_data *mine = (struct read_memory_data *)client_data; diff --git a/libarchive/test/test_tar_large.c b/libarchive/test/test_tar_large.c index 30f7efe49..5701181fa 100644 --- a/libarchive/test/test_tar_large.c +++ b/libarchive/test/test_tar_large.c @@ -73,7 +73,11 @@ struct memdata { #define GB ((int64_t)1024 * MB) #define TB ((int64_t)1024 * GB) +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t memory_read_skip(struct archive *, void *, off_t request); +#else +static int64_t memory_read_skip(struct archive *, void *, int64_t request); +#endif static ssize_t memory_read(struct archive *, void *, const void **buff); static ssize_t memory_write(struct archive *, void *, const void *, size_t); @@ -163,8 +167,13 @@ memory_read(struct archive *a, void *_private, const void **buff) } +#if ARCHIVE_VERSION_NUMBER < 3000000 static off_t memory_read_skip(struct archive *a, void *_private, off_t skip) +#else +static int64_t +memory_read_skip(struct archive *a, void *_private, int64_t skip) +#endif { struct memdata *private = _private;