+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.
/* 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
#include "streq.h"
#include "uniwidth.h"
-#undef wcwidth
-
int
-rpl_wcwidth (wchar_t wc)
+wcwidth (wchar_t wc)
+#undef wcwidth
{
/* In UTF-8 locales, use a Unicode aware width function. */
const char *encoding = locale_charset ();
-# 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,
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).
*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.
])