]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Define INT32_MAX and INT32_MIN for older compilers
authorTim Kientzle <kientzle@acm.org>
Sun, 24 Apr 2016 21:46:36 +0000 (14:46 -0700)
committerTim Kientzle <kientzle@acm.org>
Sun, 24 Apr 2016 21:46:36 +0000 (14:46 -0700)
CMakeLists.txt
build/cmake/config.h.in
configure.ac
libarchive/archive_platform.h

index 99a52fb8d0de6071e38d048fb1145be6777d673c..eedcd23e3776b63a875a92c1791e3e7b19ea5050 100644 (file)
@@ -1303,6 +1303,8 @@ 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)
index 46f9d5562563beafef34ed39f051a263de866f2b..94fbb59f5cb235d8d941280fa1b64acc20b32e9a 100644 (file)
@@ -362,6 +362,14 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have the `cygwin_conv_path' function. */
 #cmakedefine HAVE_CYGWIN_CONV_PATH 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
index 5e05a6b30db9c7287351255b6c9bd0be5573ecfa..d352991cb895b32dfb06b2f151851e8074cdfb01 100644 (file)
@@ -539,7 +539,8 @@ AC_TYPE_INT16_T
 AC_TYPE_UINT16_T
 AC_TYPE_UINT8_T
 
-AC_CHECK_DECLS([SIZE_MAX, INT64_MAX, INT64_MIN, UINT64_MAX, UINT32_MAX])
+AC_CHECK_DECLS([SIZE_MAX, INT32_MAX, INT32_MIN])
+AC_CHECK_DECLS([INT64_MAX, INT64_MIN, UINT64_MAX, UINT32_MAX])
 AC_CHECK_DECLS([INTMAX_MAX, INTMAX_MIN, UINTMAX_MAX])
 
 AC_CHECK_DECL([SSIZE_MAX],
index 64595aec6e80651b259c989727415b4c1fae37f6..b06c3cd28fa6d98c8e3c0583dd90d00df382d524 100644 (file)
 #if !HAVE_DECL_UINT32_MAX
 #define        UINT32_MAX (~(uint32_t)0)
 #endif
+#if !HAVE_DECL_INT32_MAX
+#define        INT32_MAX ((int32_t)(UINT32_MAX >> 1))
+#endif
+#if !HAVE_DECL_INT32_MIN
+#define        INT32_MIN ((int32_t)(~INT32_MAX))
+#endif
 #if !HAVE_DECL_UINT64_MAX
 #define        UINT64_MAX (~(uint64_t)0)
 #endif