summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-20 14:08:29 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-23 12:15:21 (GMT)
commite0f725f821f251165c17a7580c2000342ac505a2 (patch)
tree258f54b912a73470398a07ad2f697692d8b44c3f /Utilities
parentae4861ec2214cb025f8bf2426376a4aca9809d73 (diff)
downloadCMake-e0f725f821f251165c17a7580c2000342ac505a2.zip
CMake-e0f725f821f251165c17a7580c2000342ac505a2.tar.gz
CMake-e0f725f821f251165c17a7580c2000342ac505a2.tar.bz2
libarchive: Fix use of ssize_t in archive_entry.h
This type is not available on Windows compilers so for clients including this header we need to use `la_ssize_t` instead as we do in `archive.h`.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.h b/Utilities/cmlibarchive/libarchive/archive_entry.h
index fe86ee3..c331117 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry.h
+++ b/Utilities/cmlibarchive/libarchive/archive_entry.h
@@ -66,6 +66,27 @@ typedef int64_t la_int64_t;
# endif
#endif
+/* The la_ssize_t should match the type used in 'struct stat' */
+#if !defined(__LA_SSIZE_T_DEFINED)
+/* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
+# if ARCHIVE_VERSION_NUMBER < 4000000
+#define __LA_SSIZE_T la_ssize_t
+# endif
+#define __LA_SSIZE_T_DEFINED
+# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+# if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
+typedef ssize_t la_ssize_t;
+# elif defined(_WIN64)
+typedef __int64 la_ssize_t;
+# else
+typedef long la_ssize_t;
+# endif
+# else
+# include <unistd.h> /* ssize_t */
+typedef ssize_t la_ssize_t;
+# endif
+#endif
+
/* Get a suitable definition for mode_t */
#if ARCHIVE_VERSION_NUMBER >= 3999000
/* Switch to plain 'int' for libarchive 4.0. It's less broken than 'mode_t' */
@@ -523,9 +544,9 @@ __LA_DECL int archive_entry_acl_next_w(struct archive_entry *, int /* want_type
#define ARCHIVE_ENTRY_ACL_STYLE_COMPACT 0x00000010
__LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *,
- ssize_t * /* len */, int /* flags */);
+ la_ssize_t * /* len */, int /* flags */);
__LA_DECL char *archive_entry_acl_to_text(struct archive_entry *,
- ssize_t * /* len */, int /* flags */);
+ la_ssize_t * /* len */, int /* flags */);
__LA_DECL int archive_entry_acl_from_text_w(struct archive_entry *,
const wchar_t * /* wtext */, int /* type */);
__LA_DECL int archive_entry_acl_from_text(struct archive_entry *,