# HG changeset patch # User Bruno Haible # Date 1152031583 0 # Node ID 16e059328532169f901603908a819424298478bb # Parent b392232a8925c35c3775402980db2b19519d3017 Assume ANSI C. diff --git a/lib/ChangeLog b/lib/ChangeLog --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2006-06-27 Bruno Haible + + Assume ANSI C header files and functions. + * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros. + (mbsnwidth): Use isprint, iscntrl instead. + 2006-07-03 Jim Meyering * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this diff --git a/lib/mbswidth.c b/lib/mbswidth.c --- a/lib/mbswidth.c +++ b/lib/mbswidth.c @@ -60,18 +60,6 @@ # endif #endif -/* Get ISPRINT. */ -#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) -# define IN_CTYPE_DOMAIN(c) 1 -#else -# define IN_CTYPE_DOMAIN(c) isascii(c) -#endif -/* Undefine to protect against the definition in wctype.h of Solaris 2.6. */ -#undef ISPRINT -#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) -#undef ISCNTRL -#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c)) - /* Returns the number of columns needed to represent the multibyte character string pointed to by STRING. If a non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. @@ -195,10 +183,10 @@ { unsigned char c = (unsigned char) *p++; - if (ISPRINT (c)) + if (isprint (c)) width++; else if (!(flags & MBSW_REJECT_UNPRINTABLE)) - width += (ISCNTRL (c) ? 0 : 1); + width += (iscntrl (c) ? 0 : 1); else return -1; }