From 17394c80c690d3e5fee552d2e4f861448a908d29 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 11 Sep 2022 02:53:07 +0200 Subject: [PATCH] pipe-filter-gi: Fix test failure on native Windows. * lib/pipe-filter-aux.h (write): Redefine on native Windows. --- ChangeLog | 5 +++++ lib/pipe-filter-aux.h | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8f5fdf8c8e..bc3c9fb4de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-09-10 Bruno Haible + + pipe-filter-gi: Fix test failure on native Windows. + * lib/pipe-filter-aux.h (write): Redefine on native Windows. + 2022-09-10 Bruno Haible stdbool C++ tests: Fix for C++20. diff --git a/lib/pipe-filter-aux.h b/lib/pipe-filter-aux.h index a6864c66c5..ed6da51f3c 100644 --- a/lib/pipe-filter-aux.h +++ b/lib/pipe-filter-aux.h @@ -23,6 +23,17 @@ _GL_INLINE_HEADER_BEGIN # define PIPE_FILTER_AUX_INLINE _GL_INLINE #endif +#if defined _WIN32 && ! defined __CYGWIN__ +/* In the pipe-filter-* modules we want to use the write() function that is + not overridden to emulate SIGPIPE behaviour, because we don't want force + the caller to do + signal (SIGPIPE, SIG_DFL); + To reproduce the problem, use a gnulib testdir for the modules + 'pipe-filter-gi', 'write', 'sigpipe'. */ +# undef write +# define write _write +#endif + #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif -- 2.39.5