bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pselect: Fix compilation error in C++ mode on mingw


From: Bruno Haible
Subject: pselect: Fix compilation error in C++ mode on mingw
Date: Sun, 04 Sep 2022 15:54:19 +0200

In a testdir build on mingw, I get this compilation error:

depbase=`echo test-sys_select-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
x86_64-w64-mingw32-g++ -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -I. -I../../gltests 
-I..  -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-sys_select-c++.o -MD -MP -MF $depbase.Tpo -c -o 
test-sys_select-c++.o ../../gltests/test-sys_select-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../gllib/sys/select.h:119:0,
                 from ../../gltests/test-sys_select-c++.cc:22:
../gllib/sys/select.h:772:1: error: 'pselect' was not declared in this scope
 _GL_CXXALIASWARN (pselect);
 ^
../gllib/sys/select.h:772:1: note: suggested alternative:
../gllib/sys/select.h:755:1: note:   'gnulib::pselect'
 _GL_CXXALIAS_RPL (pselect, int,
 ^
make[4]: *** [Makefile:23382: test-sys_select-c++.o] Error 1

This patch fixes it.


2022-09-04  Bruno Haible  <bruno@clisp.org>

        pselect: Fix compilation error in C++ mode on mingw.
        * lib/sys_select.in.h (pselect): Enable the C++ alias warning only on
        glibc systems.

diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index b424f1b803..860e957fe0 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -288,7 +288,9 @@ _GL_CXXALIAS_SYS_CAST (pselect, int,
                         struct timespec const *restrict,
                         const sigset_t *restrict));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (pselect);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef pselect
 # if HAVE_RAW_DECL_PSELECT






reply via email to

[Prev in Thread] Current Thread [Next in Thread]