diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-04-15 00:53:38 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-04-15 00:53:38 +0000 |
commit | cc44f89006ca6ae738f04f8efb58efbbd52a7268 (patch) | |
tree | 77e2b47f8d4f88350fd88646e5a721011efe04d4 /lib/libarchive/archive_platform.h | |
parent | 034ed0ce440f90570c5fb879ba9edb6725caaf1c (diff) | |
download | FreeBSD-src-cc44f89006ca6ae738f04f8efb58efbbd52a7268.zip FreeBSD-src-cc44f89006ca6ae738f04f8efb58efbbd52a7268.tar.gz |
Consolidate numeric limit macros in one place; include them
only on platforms that need them. FreeBSD doesn't.
Diffstat (limited to 'lib/libarchive/archive_platform.h')
-rw-r--r-- | lib/libarchive/archive_platform.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libarchive/archive_platform.h b/lib/libarchive/archive_platform.h index f775a69..c9317cc 100644 --- a/lib/libarchive/archive_platform.h +++ b/lib/libarchive/archive_platform.h @@ -67,6 +67,23 @@ #include <stdint.h> #endif +/* Some platforms lack the standard *_MAX definitions. */ +#if !HAVE_DECL_SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif +#if !HAVE_DECL_UINT32_MAX +#define UINT32_MAX (~(uint32_t)0) +#endif +#if !HAVE_DECL_UINT64_MAX +#define UINT64_MAX (~(uint64_t)0) +#endif +#if !HAVE_DECL_INT64_MAX +#define INT64_MAX ((int64_t)(UINT64_MAX >> 1)) +#endif +#if !HAVE_DECL_INT64_MIN +#define INT64_MIN ((int64_t)(~INT64_MAX)) +#endif + /* * If this platform has <sys/acl.h>, acl_create(), acl_init(), * acl_set_file(), and ACL_USER, we assume it has the rest of the |