summaryrefslogtreecommitdiff
path: root/libiberty/safe-ctype.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2003-06-22 00:06:14 +0000
committerDJ Delorie <dj@delorie.com>2003-06-22 00:06:14 +0000
commitd005e7778f9570f95d9c4d46ef795d291e9e1d06 (patch)
tree0b11bd86c1e7c21939205250cf1d790b8a78091a /libiberty/safe-ctype.c
parent2a2ffb4bb96eaec0ae923cbccf505b85875ba0ac (diff)
downloadgdb-d005e7778f9570f95d9c4d46ef795d291e9e1d06.tar.gz
merge from gcc
Diffstat (limited to 'libiberty/safe-ctype.c')
-rw-r--r--libiberty/safe-ctype.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libiberty/safe-ctype.c b/libiberty/safe-ctype.c
index 3bac84bf68a..12d52d3bd88 100644
--- a/libiberty/safe-ctype.c
+++ b/libiberty/safe-ctype.c
@@ -33,6 +33,10 @@ Boston, MA 02111-1307, USA. */
#include <safe-ctype.h>
#include <stdio.h> /* for EOF */
+#if EOF != -1
+ #error "<safe-ctype.h> requires EOF == -1"
+#endif
+
/* Shorthand */
#define bl _sch_isblank
#define cn _sch_iscntrl
@@ -64,9 +68,7 @@ Boston, MA 02111-1307, USA. */
#define S (const unsigned short) (nv|sp|bl|pr) /* space */
/* Are we ASCII? */
-#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
- && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \
- && EOF == -1
+#if HOST_CHARSET == HC_ASCII
const unsigned short _sch_istable[256] =
{
@@ -159,5 +161,9 @@ const unsigned char _sch_toupper[256] =
};
#else
- #error "Unsupported host character set"
-#endif /* not ASCII */
+# if HOST_CHARSET == HC_EBCDIC
+ #error "FIXME: write tables for EBCDIC"
+# else
+ #error "Unrecognized host character set"
+# endif
+#endif