From 07be984c6331f16ab1b60c3b40dafa97aeb98a57 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Wed, 17 Sep 2008 17:03:33 -0400 Subject: [PATCH] Windows compilers don't support C99 int64_t. Use __int64 on Windows instead of 'long long' to make the size assumptions clearer. SVN-Revision: 205 --- libarchive/archive.h | 9 ++++++--- libarchive/archive_entry.h | 2 ++ libarchive/config_windows.h | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libarchive/archive.h b/libarchive/archive.h index 5d7819a5d..be423a3ad 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -46,11 +46,13 @@ /* Get appropriate definitions of standard POSIX-style types. */ /* These should match the types used in 'struct stat' */ #ifdef _WIN32 +#define __LA_INT64_T __int64 #define __LA_SSIZE_T long #define __LA_UID_T unsigned int #define __LA_GID_T unsigned int #else #include /* ssize_t, uid_t, and gid_t */ +#define __LA_INT64_T int64_t #define __LA_SSIZE_T ssize_t #define __LA_UID_T uid_t #define __LA_GID_T gid_t @@ -273,6 +275,7 @@ __LA_DECL int archive_read_support_compression_all(struct archive *); __LA_DECL int archive_read_support_compression_bzip2(struct archive *); __LA_DECL int archive_read_support_compression_compress(struct archive *); __LA_DECL int archive_read_support_compression_gzip(struct archive *); +__LA_DECL int archive_read_support_compression_lzma(struct archive *); __LA_DECL int archive_read_support_compression_none(struct archive *); __LA_DECL int archive_read_support_compression_program(struct archive *, const char *command); @@ -328,7 +331,7 @@ __LA_DECL int archive_read_next_header(struct archive *, * Retrieve the byte offset in UNCOMPRESSED data where last-read * header started. */ -__LA_DECL int64_t archive_read_header_position(struct archive *); +__LA_DECL __LA_INT64_T archive_read_header_position(struct archive *); /* Read data from the body of an entry. Similar to read(2). */ __LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, void *, size_t); @@ -565,9 +568,9 @@ __LA_DECL int archive_write_disk_set_user_lookup(struct archive *, * the struct archive object: */ /* Bytes written after compression or read before decompression. */ -__LA_DECL int64_t archive_position_compressed(struct archive *); +__LA_DECL __LA_INT64_T archive_position_compressed(struct archive *); /* Bytes written to compressor or read from decompressor. */ -__LA_DECL int64_t archive_position_uncompressed(struct archive *); +__LA_DECL __LA_INT64_T archive_position_uncompressed(struct archive *); __LA_DECL const char *archive_compression_name(struct archive *); __LA_DECL int archive_compression(struct archive *); diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index f7cfd8599..6ffc603fc 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -43,12 +43,14 @@ /* Get appropriate definitions of standard POSIX-style types. */ /* These should match the types used in 'struct stat' */ #ifdef _WIN32 +#define __LA_INT64_T __int64 #define __LA_UID_T unsigned int #define __LA_GID_T unsigned int #define __LA_DEV_T unsigned int #define __LA_MODE_T unsigned short #else #include +#define __LA_INT64_T int64_t #define __LA_UID_T uid_t #define __LA_GID_T gid_t #define __LA_DEV_T dev_t diff --git a/libarchive/config_windows.h b/libarchive/config_windows.h index 5afda4533..354b80aed 100644 --- a/libarchive/config_windows.h +++ b/libarchive/config_windows.h @@ -508,7 +508,7 @@ /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #if defined(_MSC_VER) -#define int64_t long long +#define int64_t __int64 #else /* #undef int64_t */ #endif @@ -544,7 +544,7 @@ /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #if defined(_MSC_VER) -#define uint64_t unsigned long long +#define uint64_t unsigned __int64 #else /* #undef uint64_t */ #endif -- 2.47.3