summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorKO Myung-Hun <komh@chollian.net>2017-10-06 22:06:55 +0900
committerBruno Haible <bruno@clisp.org>2017-10-07 09:17:33 +0200
commitec285472ea54acd77f5a98c8e5b865cd55954d3c (patch)
treea1fc7a358c9933e570deb5ff966579db17656458 /m4
parent66a99150e921aac152b8d748d19bfed43fcb4e58 (diff)
downloadgnulib-ec285472ea54acd77f5a98c8e5b865cd55954d3c.tar.gz
wcwidth: check a macro version of wcwidth () as well
Check the functionality of a macro version wcwidth () as well as a real function. This is better than undefining wcwidth on OS/2 kLIBC without functional check. * lib/wchar.in.h: Revert commit caee51. * m4/wcwidth.m4 (gl_cv_func_wcwidth_macro): Check if wcwidth () is a macro.
Diffstat (limited to 'm4')
-rw-r--r--m4/wcwidth.m417
1 files changed, 15 insertions, 2 deletions
diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4
index 58716416cf..b44a9ed0fd 100644
--- a/m4/wcwidth.m4
+++ b/m4/wcwidth.m4
@@ -1,4 +1,4 @@
-# wcwidth.m4 serial 23
+# wcwidth.m4 serial 24
dnl Copyright (C) 2006-2017 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,7 +34,20 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
HAVE_DECL_WCWIDTH=0
fi
- if test $ac_cv_func_wcwidth = yes; then
+ if test $ac_cv_func_wcwidth != yes; then
+ AC_CACHE_CHECK([whether wcwidth is a macro],
+ [gl_cv_func_wcwidth_macro],
+ [AC_EGREP_CPP([wchar_header_defines_wcwidth], [
+#include <wchar.h>
+#ifdef wcwidth
+ wchar_header_defines_wcwidth
+#endif],
+ [gl_cv_func_wcwidth_macro=yes],
+ [gl_cv_func_wcwidth_macro=no])
+ ])
+ fi
+
+ if test $ac_cv_func_wcwidth = yes -o "$gl_cv_func_wcwidth_macro" = yes; then
HAVE_WCWIDTH=1
dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1.