On mingw, without the 'sigpipe' module, I'm seeing this error: g++-3 -mno-cygwin -DHAVE_CONFIG_H -I. -I. -I. -I.. -I./.. -I../gllib -I./../gllib -I/usr/local/mingw/include -Wall -MT test-unistd-c++.o -MD -MP -MF .deps/test-unistd-c++.Tpo -c -o test-unistd-c++.o test-unistd-c++.cc In file included from test-unistd-c++.cc:22: ../gllib/unistd.h:1556: error: invalid conversion from `int (*)(int, const void*, unsigned int)' to `ssize_t (*)(int, const void*, size_t)' make[4]: *** [test-unistd-c++.o] Error 1
This fixes it. 2010-04-10 Bruno Haible <[email protected]> write: Fix a C++ test error on mingw. * lib/unistd.in.h (write): Use _GL_CXXALIAS_SYS_CAST. --- lib/unistd.in.h.orig Sat Apr 10 21:08:06 2010 +++ lib/unistd.in.h Sat Apr 10 21:07:51 2010 @@ -1268,7 +1268,10 @@ _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); # else -_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +/* Need to cast, because on mingw, the third parameter is + unsigned int count + and the return type is 'int'. */ +_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count)); # endif _GL_CXXALIASWARN (write); #endif
