Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / include / typemax.h
index 42ae517..aa21c9c 100644 (file)
@@ -4,19 +4,19 @@
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
-   Bash is free software; you can redistribute it and/or modify it under
-   the terms of the GNU General Public License as published by the Free
-   Software Foundation; either version 2, or (at your option) any later
-   version.
+   Bash is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
-   Bash is distributed in the hope that it will be useful, but WITHOUT ANY
-   WARRANTY; without even the implied warranty of MERCHANTABILITY or
-   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-   for more details.
+   Bash is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License along
-   with Bash; see the file COPYING.  If not, write to the Free Software
-   Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+   You should have received a copy of the GNU General Public License
+   along with Bash.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 /*
  * NOTE:  This should be included after config.h, limits.h, stdint.h, and
@@ -77,4 +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 */