]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Define INT32_MAX and INT64_MAX if needed.
authorDarren Tucker <dtucker@zip.com.au>
Mon, 1 May 2017 03:53:07 +0000 (13:53 +1000)
committerDarren Tucker <dtucker@zip.com.au>
Mon, 1 May 2017 03:53:55 +0000 (13:53 +1000)
defines.h

index c89f85a8d9c0abac79de9c8b3290b8d1da58e02b..0420a7e8e0ea65f46b6a41e16d425d4d21d721b7 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -328,6 +328,28 @@ typedef unsigned int size_t;
 #define SIZE_MAX SIZE_T_MAX
 #endif
 
+#ifndef INT32_MAX
+# if (SIZEOF_INT == 4)
+#  define INT32_MAX INT_MAX
+# elif (SIZEOF_LONG == 4)
+#  define INT32_MAX LONG_MAX
+# else
+#  error "need INT32_MAX"
+# endif
+#endif
+
+#ifndef INT64_MAX
+# if (SIZEOF_INT == 8)
+#  define INT64_MAX INT_MAX
+# elif (SIZEOF_LONG == 8)
+#  define INT64_MAX LONG_MAX
+# elif (SIZEOF_LONG_LONG_INT == 8)
+#  define INT64_MAX LLONG_MAX
+# else
+#  error "need INT64_MAX"
+# endif
+#endif
+
 #ifndef HAVE_SSIZE_T
 typedef int ssize_t;
 # define HAVE_SSIZE_T