[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] AC_HEADER_STDC
From: |
Bruno Haible |
Subject: |
Re: [bug-gnulib] AC_HEADER_STDC |
Date: |
Tue, 4 Jul 2006 18:46:57 +0200 |
User-agent: |
KMail/1.9.1 |
Derek R. Price wrote:
> lib/mbswidth.c: Remove sections
> dependent on !STDC_HEADERS.
Thanks, I committed to gnulib the same patch that I had done in gettext
a day earlier. It is identical to yours.
Bruno
2006-06-27 Bruno Haible <address@hidden>
Assume ANSI C header files and <ctype.h> functions.
* mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
(mbsnwidth): Use isprint, iscntrl instead.
*** mbswidth.c 28 Jun 2006 17:03:53 -0000 1.16
--- mbswidth.c 4 Jul 2006 16:45:23 -0000
***************
*** 60,77 ****
# 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.
--- 60,65 ----
***************
*** 195,204 ****
{
unsigned char c = (unsigned char) *p++;
! if (ISPRINT (c))
width++;
else if (!(flags & MBSW_REJECT_UNPRINTABLE))
! width += (ISCNTRL (c) ? 0 : 1);
else
return -1;
}
--- 183,192 ----
{
unsigned char c = (unsigned char) *p++;
! if (isprint (c))
width++;
else if (!(flags & MBSW_REJECT_UNPRINTABLE))
! width += (iscntrl (c) ? 0 : 1);
else
return -1;
}
- Re: AC_HEADER_STDC, (continued)
- Re: AC_HEADER_STDC, Bruno Haible, 2006/07/06
- Re: AC_HEADER_STDC, Bruno Haible, 2006/07/06
- Re: AC_HEADER_STDC, Ralf Wildenhues, 2006/07/06
- Re: AC_HEADER_STDC, Paul Eggert, 2006/07/06
- Re: AC_HEADER_STDC, Paul Eggert, 2006/07/06
- Re: AC_HEADER_STDC, Paul Eggert, 2006/07/06
- Re: AC_HEADER_STDC, Bruno Haible, 2006/07/20
Re: [bug-gnulib] AC_HEADER_STDC,
Bruno Haible <=