summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-01 19:45:43 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-01 19:59:10 (GMT)
commit22c5b0c244f90696c97f05647c43775e0847d98f (patch)
tree1064cb436f94177eb02346f8d1f62f0de21bb1df /Utilities
parenta7e66cac164c0bc6db01a5772d63f07b28d7e698 (diff)
downloadCMake-22c5b0c244f90696c97f05647c43775e0847d98f.zip
CMake-22c5b0c244f90696c97f05647c43775e0847d98f.tar.gz
CMake-22c5b0c244f90696c97f05647c43775e0847d98f.tar.bz2
libarchive: Avoid configure-time checks for integer range constants
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmThirdPartyChecks.cmake12
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt18
-rw-r--r--Utilities/cmlibarchive/build/cmake/config.h.in44
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_platform.h42
4 files changed, 15 insertions, 101 deletions
diff --git a/Utilities/cmThirdPartyChecks.cmake b/Utilities/cmThirdPartyChecks.cmake
index e3ce469..0b57940 100644
--- a/Utilities/cmThirdPartyChecks.cmake
+++ b/Utilities/cmThirdPartyChecks.cmake
@@ -260,18 +260,6 @@ if(WIN32)
# curl and expat: stdlib.h, stdarg.h, string.h, float.h
set(STDC_HEADERS 1)
- # FIXME: Teach libarchive to use #if instead of configure-time checks.
- set(HAVE_DECL_INT32_MAX 1)
- set(HAVE_DECL_INT32_MIN 1)
- set(HAVE_DECL_INT64_MAX 1)
- set(HAVE_DECL_INT64_MIN 1)
- set(HAVE_DECL_INTMAX_MAX 1)
- set(HAVE_DECL_INTMAX_MIN 1)
- set(HAVE_DECL_SIZE_MAX 1)
- set(HAVE_DECL_UINT32_MAX 1)
- set(HAVE_DECL_UINT64_MAX 1)
- set(HAVE_DECL_UINTMAX_MAX 1)
-
# libarchive looks for external hash implementations.
set(ARCHIVE_CRYPTO_MD5_LIBC 0)
set(ARCHIVE_CRYPTO_MD5_LIBMD 0)
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 0a55d0b..fa88514 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -1488,27 +1488,9 @@ ENDIF(HAVE_STRERROR_R)
#
# Check defines
#
-SET(headers "limits.h")
-IF(HAVE_STDINT_H)
- LIST(APPEND headers "stdint.h")
-ENDIF(HAVE_STDINT_H)
-IF(HAVE_INTTYPES_H)
- LIST(APPEND headers "inttypes.h")
-ENDIF(HAVE_INTTYPES_H)
CHECK_SYMBOL_EXISTS(EFTYPE "errno.h" HAVE_EFTYPE)
CHECK_SYMBOL_EXISTS(EILSEQ "errno.h" HAVE_EILSEQ)
CHECK_SYMBOL_EXISTS(D_MD_ORDER "langinfo.h" HAVE_D_MD_ORDER)
-CHECK_SYMBOL_EXISTS(INT32_MAX "${headers}" HAVE_DECL_INT32_MAX)
-CHECK_SYMBOL_EXISTS(INT32_MIN "${headers}" HAVE_DECL_INT32_MIN)
-CHECK_SYMBOL_EXISTS(INT64_MAX "${headers}" HAVE_DECL_INT64_MAX)
-CHECK_SYMBOL_EXISTS(INT64_MIN "${headers}" HAVE_DECL_INT64_MIN)
-CHECK_SYMBOL_EXISTS(INTMAX_MAX "${headers}" HAVE_DECL_INTMAX_MAX)
-CHECK_SYMBOL_EXISTS(INTMAX_MIN "${headers}" HAVE_DECL_INTMAX_MIN)
-CHECK_SYMBOL_EXISTS(UINT32_MAX "${headers}" HAVE_DECL_UINT32_MAX)
-CHECK_SYMBOL_EXISTS(UINT64_MAX "${headers}" HAVE_DECL_UINT64_MAX)
-CHECK_SYMBOL_EXISTS(UINTMAX_MAX "${headers}" HAVE_DECL_UINTMAX_MAX)
-CHECK_SYMBOL_EXISTS(SIZE_MAX "${headers}" HAVE_DECL_SIZE_MAX)
-CHECK_SYMBOL_EXISTS(SSIZE_MAX "limits.h" HAVE_DECL_SSIZE_MAX)
#
# Check struct members
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
index dc58b13..b320615 100644
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
@@ -415,58 +415,14 @@ typedef unsigned char uint8_t;
don't. */
#cmakedefine HAVE_DECL_ACL_USER 1
-/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_INT32_MAX 1
-
-/* Define to 1 if you have the declaration of `INT32_MIN', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_INT32_MIN 1
-
-/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_INT64_MAX 1
-
-/* Define to 1 if you have the declaration of `INT64_MIN', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_INT64_MIN 1
-
-/* Define to 1 if you have the declaration of `INTMAX_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_INTMAX_MAX 1
-
-/* Define to 1 if you have the declaration of `INTMAX_MIN', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_INTMAX_MIN 1
-
/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
*/
#cmakedefine HAVE_DECL_SETACL 1
-/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_SIZE_MAX 1
-
-/* Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_SSIZE_MAX 1
-
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#cmakedefine HAVE_DECL_STRERROR_R 1
-/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_UINT32_MAX 1
-
-/* Define to 1 if you have the declaration of `UINT64_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_UINT64_MAX 1
-
-/* Define to 1 if you have the declaration of `UINTMAX_MAX', and to 0 if you
- don't. */
-#cmakedefine HAVE_DECL_UINTMAX_MAX 1
-
/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
you don't. */
#cmakedefine HAVE_DECL_XATTR_NOFOLLOW 1
diff --git a/Utilities/cmlibarchive/libarchive/archive_platform.h b/Utilities/cmlibarchive/libarchive/archive_platform.h
index 90db31f..3273930 100644
--- a/Utilities/cmlibarchive/libarchive/archive_platform.h
+++ b/Utilities/cmlibarchive/libarchive/archive_platform.h
@@ -107,56 +107,44 @@
/* Borland warns about its own constants! */
#if defined(__BORLANDC__)
-# if HAVE_DECL_UINT64_MAX
-# undef UINT64_MAX
-# undef HAVE_DECL_UINT64_MAX
-# endif
-# if HAVE_DECL_UINT64_MIN
-# undef UINT64_MIN
-# undef HAVE_DECL_UINT64_MIN
-# endif
-# if HAVE_DECL_INT64_MAX
-# undef INT64_MAX
-# undef HAVE_DECL_INT64_MAX
-# endif
-# if HAVE_DECL_INT64_MIN
-# undef INT64_MIN
-# undef HAVE_DECL_INT64_MIN
-# endif
+# undef UINT64_MAX
+# undef UINT64_MIN
+# undef INT64_MAX
+# undef INT64_MIN
#endif
/* Some platforms lack the standard *_MAX definitions. */
-#if !HAVE_DECL_SIZE_MAX
+#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
-#if !HAVE_DECL_SSIZE_MAX
+#ifndef SSIZE_MAX
#define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
#endif
-#if !HAVE_DECL_UINT32_MAX
+#ifndef UINT32_MAX
#define UINT32_MAX (~(uint32_t)0)
#endif
-#if !HAVE_DECL_INT32_MAX
+#ifndef INT32_MAX
#define INT32_MAX ((int32_t)(UINT32_MAX >> 1))
#endif
-#if !HAVE_DECL_INT32_MIN
+#ifndef INT32_MIN
#define INT32_MIN ((int32_t)(~INT32_MAX))
#endif
-#if !HAVE_DECL_UINT64_MAX
+#ifndef UINT64_MAX
#define UINT64_MAX (~(uint64_t)0)
#endif
-#if !HAVE_DECL_INT64_MAX
+#ifndef INT64_MAX
#define INT64_MAX ((int64_t)(UINT64_MAX >> 1))
#endif
-#if !HAVE_DECL_INT64_MIN
+#ifndef INT64_MIN
#define INT64_MIN ((int64_t)(~INT64_MAX))
#endif
-#if !HAVE_DECL_UINTMAX_MAX
+#ifndef UINTMAX_MAX
#define UINTMAX_MAX (~(uintmax_t)0)
#endif
-#if !HAVE_DECL_INTMAX_MAX
+#ifndef INTMAX_MAX
#define INTMAX_MAX ((intmax_t)(UINTMAX_MAX >> 1))
#endif
-#if !HAVE_DECL_INTMAX_MIN
+#ifndef INTMAX_MIN
#define INTMAX_MIN ((intmax_t)(~INTMAX_MAX))
#endif