From f229e6327e3ae6186e85b6ff0dca1c3a2d179905 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Fri, 24 Sep 1999 12:50:14 +0000 Subject: [PATCH] 1999-09-24 Ben Elliston * acspecific.m4 (AC_HEADER_STDC): Define ISLOWER and ISUPPER macros correctly on EBCDIC systems. Contributed by Kurt D. Zeilenga . Fix for autoconf/6. --- ChangeLog | 6 ++++++ acspecific.m4 | 7 +++++++ lib/autoconf/specific.m4 | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index e282f332..323ce141 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-09-24 Ben Elliston + + * acspecific.m4 (AC_HEADER_STDC): Define ISLOWER and ISUPPER + macros correctly on EBCDIC systems. Contributed by Kurt D. + Zeilenga . Fix for autoconf/6. + 1999-09-24 Jim Blandy * acspecific.m4 (AC_C_VOLATILE): New test. diff --git a/acspecific.m4 b/acspecific.m4 index 1ade191c..3e5f56a1 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -711,8 +711,15 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. AC_TRY_RUN([#include +#if ((' ' & 0x0FF) == 0x020) #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +#define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +#define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 1ade191c..3e5f56a1 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -711,8 +711,15 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. AC_TRY_RUN([#include +#if ((' ' & 0x0FF) == 0x020) #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +#define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +#define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);