MfP4: Generalize int64_t in the public headers to support compilers

which have a 64-bit integer type but don't provide standard C99 definitions.
This commit is contained in:
Tim Kientzle 2008-09-18 04:19:06 +00:00
parent 96c41c08b0
commit c42f5c226a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183136
2 changed files with 9 additions and 5 deletions

View file

@ -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 <unistd.h> /* 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
@ -328,7 +330,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 +567,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 *);

View file

@ -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 <unistd.h>
#define __LA_INT64_T int64_t
#define __LA_UID_T uid_t
#define __LA_GID_T gid_t
#define __LA_DEV_T dev_t
@ -200,7 +202,7 @@ __LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
__LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
__LA_DECL int64_t archive_entry_size(struct archive_entry *);
__LA_DECL __LA_INT64_T archive_entry_size(struct archive_entry *);
__LA_DECL int archive_entry_size_is_set(struct archive_entry *);
__LA_DECL const char *archive_entry_strmode(struct archive_entry *);
__LA_DECL const char *archive_entry_symlink(struct archive_entry *);
@ -261,7 +263,7 @@ __LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T);
__LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_size(struct archive_entry *, int64_t);
__LA_DECL void archive_entry_set_size(struct archive_entry *, __LA_INT64_T);
__LA_DECL void archive_entry_unset_size(struct archive_entry *);
__LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *);