|
From: | Christian Biesinger |
Subject: | Re: Compile error (again) with GNULIB_NAMESPACE and C++ and Mingw |
Date: | Fri, 14 Feb 2020 22:03:17 -0500 |
Hi Christian,
> This was previously fixed but I again see a compile error (with gnulib
> at 4fcedca004fd13aecb5c6f235a988a5548bcb9a4)
>
> In file included from /usr/share/mingw-w64/include/io.h:10,
> from gnulib/import/stdio.h:146,
> from gnulib/import/wchar.h:80,
> from
> /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/cwchar:44,
> from
> /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/bits/postypes.h:40,
> from
> /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/iosfwd:40,
> from
> /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/ios:38,
> from
> /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/istream:38,
> from
> /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/sstream:38,
> from test.cc:4:
> gnulib/import/wctype.h: In member function
> ‘gnulib::_gl_iswdigit_wrapper::operator
> gnulib::_gl_iswdigit_wrapper::type() const’:
> gnulib/import/wctype.h:1007:1: error: invalid conversion from ‘int
> (*)(wint_t)’ {aka ‘int (*)(short unsigned int)’} to
> ‘gnulib::_gl_iswdigit_wrapper::type’ {aka ‘int (*)(unsigned int)’}
> [-fpermissive]
> _GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
> ^~~~~~~~~~~~~~~~
> gnulib/import/wctype.h: In member function
> ‘gnulib::_gl_iswxdigit_wrapper::operator
> gnulib::_gl_iswxdigit_wrapper::type() const’:
> gnulib/import/wctype.h:1042:1: error: invalid conversion from ‘int
> (*)(wint_t)’ {aka ‘int (*)(short unsigned int)’} to
> ‘gnulib::_gl_iswxdigit_wrapper::type’ {aka ‘int (*)(unsigned int)’}
> [-fpermissive]
> _GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
> ^~~~~~~~~~~~~~~~
Thanks for the report. I reproduce with a testdir and the exact module list
you gave.
This patch fixes it.
2020-02-14 Bruno Haible <address@hidden>
wctype-h: Fix compilation errors in C++ (regression from 2020-01-25).
Reported by Christian Biesinger in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00064.html>.
* lib/wctype.in.h (iswdigit, iswxdigit): Don't declare if the
corresponding module is not enabled.
* tests/test-wctype-h-c++.cc (iswdigit, iswxdigit): Don't check the
prototype if the corresponding module is not enabled.
diff --git a/lib/wctype.in.h b/lib/wctype.in.h
index 5d266d9..06f3e07 100644
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -556,10 +556,12 @@ _GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
#else
_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
#endif
-#if @REPLACE_ISWDIGIT@
+#if @GNULIB_ISWDIGIT@
+# if @REPLACE_ISWDIGIT@
_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
-#else
+# else
_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+# endif
#endif
#if @REPLACE_ISWCNTRL@
_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
@@ -591,10 +593,12 @@ _GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
#else
_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
#endif
-#if @REPLACE_ISWXDIGIT@
+#if @GNULIB_ISWXDIGIT@
+# if @REPLACE_ISWXDIGIT@
_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
-#else
+# else
_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+# endif
#endif
#if __GLIBC__ >= 2
_GL_CXXALIASWARN (iswalnum);
diff --git a/tests/test-wctype-h-c++.cc b/tests/test-wctype-h-c++.cc
index 76a83bc..ccc8369 100644
--- a/tests/test-wctype-h-c++.cc
+++ b/tests/test-wctype-h-c++.cc
@@ -27,14 +27,18 @@
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalnum, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalpha, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswcntrl, int, (wint_t));
+#if GNULIB_TEST_ISWDIGIT
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswdigit, int, (wint_t));
+#endif
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswgraph, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswlower, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswprint, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswpunct, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswspace, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswupper, int, (wint_t));
+#if GNULIB_TEST_ISWXDIGIT
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswxdigit, int, (wint_t));
+#endif
#if GNULIB_TEST_ISWBLANK
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswblank, int, (wint_t));
#endif
[Prev in Thread] | Current Thread | [Next in Thread] |