From 85514c7e0bb1c4b65fd3ec677f7f264f29acf3fd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 3 May 1999 17:59:43 +0000 Subject: [PATCH] (TOLOWER): Define. (TOUPPER): Define. --- src/sys2.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sys2.h b/src/sys2.h index a58e948..bd36780 100644 --- a/src/sys2.h +++ b/src/sys2.h @@ -62,7 +62,7 @@ char *alloca (); character >= 128 which gets sign-extended to a negative value. The macro ISUPPER protects against this as well." */ -#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) +#if STDC_HEADERS || (!defined (isascii) && !HAVE_ISASCII) # define IN_CTYPE_DOMAIN(c) 1 #else # define IN_CTYPE_DOMAIN(c) isascii(c) @@ -90,6 +90,14 @@ char *alloca (); #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c)) #define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) +#if STDC_HEADERS +# define TOLOWER(Ch) tolower (Ch) +# define TOUPPER(Ch) toupper (Ch) +#else +# define TOLOWER(Ch) (ISUPPER (Ch) ? tolower (Ch) : (Ch)) +# define TOUPPER(Ch) (ISLOWER (Ch) ? toupper (Ch) : (Ch)) +#endif + /* ISDIGIT differs from ISDIGIT_LOCALE, as follows: - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. -- 2.7.4