summaryrefslogtreecommitdiff
path: root/include/safe-ctype.h
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
commitc98ad3ef241055bde8b09569d51140060c308423 (patch)
tree867c4237856a7aed8f0f2fababa9f645fa5cec30 /include/safe-ctype.h
parent44d2b6a3a71a65cc4d6c0948b413c6c35d31e6ec (diff)
downloadbinutils-redhat-c98ad3ef241055bde8b09569d51140060c308423.tar.gz
merge from gcc
Diffstat (limited to 'include/safe-ctype.h')
-rw-r--r--include/safe-ctype.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/safe-ctype.h b/include/safe-ctype.h
index b2ad8490bd..c3e154c6f9 100644
--- a/include/safe-ctype.h
+++ b/include/safe-ctype.h
@@ -37,7 +37,24 @@ Boston, MA 02111-1307, USA. */
#ifdef isalpha
#error "safe-ctype.h and ctype.h may not be used simultaneously"
+#endif
+
+/* Determine host character set. */
+#define HC_UNKNOWN 0
+#define HC_ASCII 1
+#define HC_EBCDIC 2
+
+#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
+ && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
+# define HOST_CHARSET HC_ASCII
#else
+# if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
+ && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
+# define HOST_CHARSET HC_EBCDIC
+# else
+# define HOST_CHARSET HC_UNKNOWN
+# endif
+#endif
/* Categories. */
@@ -99,5 +116,4 @@ extern const unsigned char _sch_tolower[256];
#define TOUPPER(c) _sch_toupper[(c) & 0xff]
#define TOLOWER(c) _sch_tolower[(c) & 0xff]
-#endif /* no ctype.h */
#endif /* SAFE_CTYPE_H */