]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix Borland integer constants
authorBrad King <brad.king@kitware.com>
Wed, 11 Nov 2009 17:13:34 +0000 (12:13 -0500)
committerBrad King <brad.king@kitware.com>
Wed, 11 Nov 2009 17:13:34 +0000 (12:13 -0500)
Some versions of Borland provide <stdint.h>, so we use it when possible.
However, the 64-bit signed and unsigned integer min/max constants cause
overflow warnings from Borland itself!  For these constants we fall back
on our default definitions.

SVN-Revision: 1647

libarchive/archive_platform.h

index 6a4b08d219875c82dce61b367127a06d0fe50109..c54073357b3613f90c515eb7e95a649d0309e841 100644 (file)
 #include <stdint.h>
 #endif
 
+/* 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
+#endif
+
 /* Some platforms lack the standard *_MAX definitions. */
 #if !HAVE_DECL_SIZE_MAX
 #define        SIZE_MAX (~(size_t)0)