Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / include / typemax.h
index 32e7a89..aa21c9c 100644 (file)
@@ -77,8 +77,27 @@ static const unsigned long long int maxquad = ULLONG_MAX;
 #  define ULLONG_MAX maxquad
 #endif
 
+#if !defined (INTMAX_MAX) || !defined (INTMAX_MIN)
+
+#if SIZEOF_INTMAX_T == SIZEOF_LONG_LONG
+#  define INTMAX_MAX   LLONG_MAX
+#  define INTMAX_MIN   LLONG_MIN
+#elif SIZEOF_INTMAX_T == SIZEOF_LONG
+#  define INTMAX_MAX   LONG_MAX
+#  define INTMAX_MIN   LONG_MIN
+#else
+#  define INTMAX_MAX   INT_MAX
+#  define INTMAX_MIN   INT_MIN
+#endif
+
+#endif
+
 #ifndef SSIZE_MAX
 #  define SSIZE_MAX    32767           /* POSIX minimum max */
 #endif
 
+#ifndef SIZE_MAX
+#  define SIZE_MAX     65535           /* POSIX minimum max */
+#endif
+
 #endif /* _SH_TYPEMAX_H */