From ed7ad33802a5bcca3ff2ebe4db03b104781fad11 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 15 Jun 2005 16:07:14 +0000 Subject: [PATCH] change wint_t's back to wchar_t's to fix compilation on Mac OS 10.4.1 git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2676 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 32 ++++++++++++++++++-------------- src/chars.c | 4 ++-- src/proto.h | 4 ++-- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d5d1c54..f6f7198d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,20 +55,20 @@ CVS code - main(), search_init(), nanorc.sample, nano.1, nanorc.5, nano.texi, etc. (DLR) - Various cleanups and improvements in chars.c. Remove some - unnecessary w?ctype wrappers; change other ctype wrappers to - take wint_t instead of wchar_t; rename some functions for - consistency; add functions to detect blank characters in a - string, for use in rcfile option parsing; and don't count - matches between valid and invalid multibyte sequences anymore, - as it causes problems when doing a replace. New functions - is_valid_mbstring(), has_blank_chars(), and - has_blank_mbchars(); changes to is_alnum_mbchar(), - is_blank_char() (renamed nisblank()), is_blank_mbchar(), - is_blank_wchar() (renamed niswblank()), is_cntrl_wchar(), - control_rep(), control_mbrep(), make_mbstring() (renamed - make_valid_mbstring()), mbstrncasecmp(), mbstrcasestr(), - mbrevstrcasestr(), etc.; removal of is_alnum_char() and - is_alnum_wchar(). (DLR) + unnecessary w?ctype wrappers; change the wctype wrappers to + take wint_t instead of wchar_t to match the functions they + wrap; rename some functions for consistency; add functions to + detect blank characters in a string, for use in rcfile option + parsing; and don't count matches between valid and invalid + multibyte sequences anymore, as it causes problems when doing + a replace. New functions is_valid_mbstring(), + has_blank_chars(), and has_blank_mbchars(); changes to + is_alnum_mbchar(), is_blank_char() (renamed nisblank()), + is_blank_mbchar(), is_blank_wchar() (renamed niswblank()), + is_cntrl_wchar(), control_rep(), control_mbrep(), + make_mbstring() (renamed make_valid_mbstring()), + mbstrncasecmp(), mbstrcasestr(), mbrevstrcasestr(), etc.; + removal of is_alnum_char() and is_alnum_wchar(). (DLR) - Implement word count via Meta-D at the main window. Note that this is disabled when NANO_SMALL is defined. New functions do_word_count() and do_next_word_void(); changes to @@ -82,6 +82,10 @@ CVS code - - Fix #ifdefs so that nano compiles with NANO_SMALL defined and DISABLE_TABCOMP undefined. Changes to revstrstr() and free_charptrarray() (renamed free_chararray()). (DLR) + - Change the wctype wrappers to take wchar_t's again, as they + still work the same way with them. This also fixes + compilation on Mac OS X 10.4.1, which doesn't seem to define a + wint_t type. (DLR, problem found by Emily Jackson) - chars.c: make_mbstring() - Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a diff --git a/src/chars.c b/src/chars.c index 23373ded..a42f53dd 100644 --- a/src/chars.c +++ b/src/chars.c @@ -49,7 +49,7 @@ int nisblank(int c) #if defined(NANO_WIDE) && !defined(HAVE_ISWBLANK) /* This function is equivalent to iswblank(). */ -int niswblank(wint_t wc) +int niswblank(wchar_t wc) { return iswspace(wc) && (wc == '\t' || !is_cntrl_wchar(wc)); } @@ -116,7 +116,7 @@ bool is_cntrl_char(int c) /* This function is equivalent to iscntrl() for wide characters, except * in that it also handles wide control characters with their high bits * set. */ -bool is_cntrl_wchar(wint_t wc) +bool is_cntrl_wchar(wchar_t wc) { return (0 <= wc && wc < 32) || (127 <= wc && wc < 160); } diff --git a/src/proto.h b/src/proto.h index 5dde503d..7da7f068 100644 --- a/src/proto.h +++ b/src/proto.h @@ -163,14 +163,14 @@ extern char *homedir; int nisblank(int c); #endif #if defined(NANO_WIDE) && !defined(HAVE_ISWBLANK) -int niswblank(wint_t wc); +int niswblank(wchar_t wc); #endif bool is_byte(int c); bool is_alnum_mbchar(const char *c); bool is_blank_mbchar(const char *c); bool is_cntrl_char(int c); #ifdef NANO_WIDE -bool is_cntrl_wchar(wint_t wc); +bool is_cntrl_wchar(wchar_t wc); #endif bool is_cntrl_mbchar(const char *c); bool is_punct_mbchar(const char *c);