(TOLOWER): Define.
authorJim Meyering <jim@meyering.net>
Mon, 3 May 1999 17:59:43 +0000 (17:59 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 3 May 1999 17:59:43 +0000 (17:59 +0000)
(TOUPPER): Define.

src/sys2.h

index a58e948..bd36780 100644 (file)
@@ -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.