From: Tim Kientzle Date: Thu, 12 Jan 2012 06:20:17 +0000 (-0500) Subject: Remove the unused system types from the public headers. We stripped X-Git-Tag: v3.0.4~2^2~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dacf7241ff9981828502fcbab3fe1a25008f083c;p=thirdparty%2Flibarchive.git Remove the unused system types from the public headers. We stripped out almost all of the system-specific ino_t, uid_t, gid_t, etc, types from the libarchive public API, so these definitions are no longer needed. In practice, those types are broken on enough systems that it just wasn't worth trying to use them. SVN-Revision: 4137 --- diff --git a/libarchive/archive.h b/libarchive/archive.h index a59aa1e6b..4b899fe39 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -56,23 +56,14 @@ # else # define __LA_SSIZE_T long # endif -# if defined(__BORLANDC__) -# define __LA_UID_T uid_t -# define __LA_GID_T gid_t -# else -# define __LA_UID_T short -# define __LA_GID_T short -# endif #else -# include /* ssize_t, uid_t, and gid_t */ +# include /* ssize_t */ # if defined(_SCO_DS) # define __LA_INT64_T long long # else # define __LA_INT64_T int64_t # endif # define __LA_SSIZE_T ssize_t -# define __LA_UID_T uid_t -# define __LA_GID_T gid_t #endif /* @@ -818,8 +809,6 @@ __LA_DECL int archive_file_count(struct archive *); /* These are meaningless outside of this header. */ #undef __LA_DECL -#undef __LA_GID_T -#undef __LA_UID_T /* These need to remain defined because they're used in the * callback type definitions. XXX Fix this. This is ugly. XXX */ diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index 1db2ee1f2..3a3857a54 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -47,21 +47,9 @@ #include #endif -/* Get appropriate definitions of standard POSIX-style types. */ -/* These should match the types used in 'struct stat' */ +/* Get a suitable 64-bit integer type. */ #if defined(_WIN32) && !defined(__CYGWIN__) -#define __LA_INT64_T __int64 -# if defined(__BORLANDC__) -# define __LA_UID_T uid_t /* Remove in libarchive 3.2 */ -# define __LA_GID_T gid_t /* Remove in libarchive 3.2 */ -# define __LA_DEV_T dev_t -# define __LA_MODE_T mode_t -# else -# define __LA_UID_T short /* Remove in libarchive 3.2 */ -# define __LA_GID_T short /* Remove in libarchive 3.2 */ -# define __LA_DEV_T unsigned int -# define __LA_MODE_T unsigned short -# endif +# define __LA_INT64_T __int64 #else #include # if defined(_SCO_DS) @@ -69,17 +57,17 @@ # else # define __LA_INT64_T int64_t # endif -# define __LA_UID_T uid_t /* Remove in libarchive 3.2 */ -# define __LA_GID_T gid_t /* Remove in libarchive 3.2 */ -# define __LA_DEV_T dev_t -# define __LA_MODE_T mode_t #endif -/* - * Remove this for libarchive 3.2, since ino_t is no longer used. - */ -#define __LA_INO_T ino_t - +/* 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' */ +# define __LA_MODE_T int +#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) +# define __LA_MODE_T unsigned short +#else +# define __LA_MODE_T mode_t +#endif /* * On Windows, define LIBARCHIVE_STATIC if you're building or using a @@ -149,6 +137,10 @@ struct archive_entry; * portable values to platform-native values when entries are read from * or written to disk. */ +/* + * In libarchive 4.0, we can drop the casts here. + * They're needed to work around Borland C's broken mode_t. + */ #define AE_IFMT ((__LA_MODE_T)0170000) #define AE_IFREG ((__LA_MODE_T)0100000) #define AE_IFLNK ((__LA_MODE_T)0120000) @@ -321,7 +313,10 @@ __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char * manipulate archives on systems different than the ones they were * created on. * - * TODO: On Linux, provide both stat32 and stat64 versions of these functions. + * TODO: On Linux and other LFS systems, provide both stat32 and + * stat64 versions of these functions and all of the macro glue so + * that archive_entry_stat is magically defined to + * archive_entry_stat32 or archive_entry_stat64 as appropriate. */ __LA_DECL const struct stat *archive_entry_stat(struct archive_entry *); __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);