aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-05-27 22:05:01 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-27 22:05:01 +0000
commitf12bc141e11b308701fe665cd3d9735c30366672 (patch)
tree8c5bb50a6dfed07bbf3f54f878d15dd7668b6e40 /gcc/system.h
parentc190ed67f702f98dc1aa1d9b6bc83a42333e8731 (diff)
downloadgcc-f12bc141e11b308701fe665cd3d9735c30366672.zip
gcc-f12bc141e11b308701fe665cd3d9735c30366672.tar.gz
gcc-f12bc141e11b308701fe665cd3d9735c30366672.tar.bz2
configure.in: Add AC_CHECK_TYPE(ssize_t).
* configure.in: Add AC_CHECK_TYPE(ssize_t). Remove commented out check for wchar_t. * acconfig.h: Add template for ssize_t. Remove @TOP@. * system.h: Add infrastructure for defining missing TYPE_MAX/TYPE_MIN macros. Use it to provide fallback definitions of UCHAR_MAX and SSIZE_MAX. * configure: Regenerate. * config.in: Regenerate. From-SVN: r34212
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h
index d5526b2..e08c168 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -234,6 +234,26 @@ extern int errno;
# endif /* defined(HOST_BITS_PER_LONG) && defined(HOST_BITS_PER_LONGLONG) */
#endif /* ! HOST_WIDEST_INT */
+/* Infrastructure for defining missing _MAX and _MIN macros. Note that
+ macros defined with these cannot be used in #if. */
+
+/* The extra casts work around common compiler bugs. */
+#define INTTYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
+ It is necessary at least when t == time_t. */
+#define INTTYPE_MINIMUM(t) ((t) (INTTYPE_SIGNED (t) \
+ ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
+#define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
+
+/* Use that infrastructure to provide a few constants. */
+#ifndef UCHAR_MAX
+# define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char)
+#endif
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX INTTYPE_MAXIMUM (ssize_t)
+#endif
+
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>