Mercurial > hg > octave-lyh > gnulib-hg
changeset 13135:3500e68d2a04
wcwidth: Fix C++ test error on mingw.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 04 Apr 2010 02:42:00 +0200 |
parents | 080377ada58c |
children | 2241c7e2a3f8 |
files | ChangeLog lib/wcwidth.c m4/wcwidth.m4 |
diffstat | 3 files changed, 17 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-04-03 Bruno Haible <bruno@clisp.org> + + wcwidth: Fix C++ test error on mingw. + * lib/wcwidth.c (wcwidth): Renamed from rpl_wcwidth. + * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): If the wcwidth function does not + exist, don't set REPLACE_WCWIDTH. Instead, rely on HAVE_DECL_WCWIDTH. + 2010-04-03 Bruno Haible <bruno@clisp.org> nanosleep: Fix C++ test error on mingw.
--- a/lib/wcwidth.c +++ b/lib/wcwidth.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a character. - Copyright (C) 2006, 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,10 +26,9 @@ #include "streq.h" #include "uniwidth.h" +int +wcwidth (wchar_t wc) #undef wcwidth - -int -rpl_wcwidth (wchar_t wc) { /* In UTF-8 locales, use a Unicode aware width function. */ const char *encoding = locale_charset ();
--- a/m4/wcwidth.m4 +++ b/m4/wcwidth.m4 @@ -1,4 +1,4 @@ -# wcwidth.m4 serial 15 +# wcwidth.m4 serial 16 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,9 +34,7 @@ HAVE_DECL_WCWIDTH=0 fi - if test $ac_cv_func_wcwidth = no; then - REPLACE_WCWIDTH=1 - else + if test $ac_cv_func_wcwidth = yes; then dnl On MacOS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. dnl This leads to bugs in 'ls' (coreutils). @@ -84,11 +82,13 @@ *no) REPLACE_WCWIDTH=1 ;; esac fi - if test $REPLACE_WCWIDTH = 1; then + if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1; then AC_LIBOBJ([wcwidth]) fi - - if test $REPLACE_WCWIDTH = 1 || test $HAVE_DECL_WCWIDTH = 0; then + if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1 \ + || test $HAVE_DECL_WCWIDTH = 0; then gl_REPLACE_WCHAR_H fi + dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not + dnl have the wcwidth function, then it does not declare it. ])