diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-01-16 22:13:51 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-01-16 22:13:51 +0000 |
commit | c78b57210eccac72647f863add37103f63772aa7 (patch) | |
tree | bfb0a79c240b0b2d8edd9439617cd84a4665df3f /lib/libarchive/archive_platform.h | |
parent | a8c5c0fe7e55b0a11c3233f483e36f391f998b16 (diff) | |
download | FreeBSD-src-c78b57210eccac72647f863add37103f63772aa7.zip FreeBSD-src-c78b57210eccac72647f863add37103f63772aa7.tar.gz |
Implement a custom print formatter (archive_string_vsprintf)
for libarchive error messages. Mostly, this
avoids a portability headache related to
copying va_list arguments (some FreeBSD 5
platforms require va_copy; FreeBSD 4 doesn't
support va_copy at all). It also dramatically reduces the
size of libarchive for embedded applications:
a minimal "untar" program using libarchive can now be
under 64k statically linked (as opposed to ~100k
using library *printf() functions).
MFC after: 14 days
Diffstat (limited to 'lib/libarchive/archive_platform.h')
-rw-r--r-- | lib/libarchive/archive_platform.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libarchive/archive_platform.h b/lib/libarchive/archive_platform.h index 490bcba..0e98ad3 100644 --- a/lib/libarchive/archive_platform.h +++ b/lib/libarchive/archive_platform.h @@ -105,6 +105,12 @@ #include <inttypes.h> #endif +/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */ +#if defined(__FreeBSD__) && __FreeBSD__ < 5 +#define intmax_t int64_t +#define uintmax_t uint64_t +#endif + /* TODO: Test for the functions we use as well... */ #if HAVE_SYS_ACL_H #define HAVE_POSIX_ACLS 1 |