pthread_sigmask: Avoid compilation error on mingw with gcc >= 14

Bruno Haible via Gnulib discussion list <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <1863103.VLH7GnMWUR@cagnes>
Cygwin now ships gcc 14.4 as mingw compiler, instead of gcc 13.4. This leads
to a compilation error in gettext/libtextstyle:

In file included from ../../../libtextstyle/lib/fatal-signal.c:19:
../../../libtextstyle/lib/fatal-signal.c: In function 'libtextstyle_block_fatal_signals':
./config.h:728:25: error: implicit declaration of function 'libtextstyle_pthread_sigmask'; did you mean 'libtextstyle_at_fatal_signal'? [-Wimplicit-function-declaration]
  728 | #define pthread_sigmask libtextstyle_pthread_sigmask
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../libtextstyle/lib/fatal-signal.c:321:9: note: in expansion of macro 'pthread_sigmask'
  321 |         pthread_sigmask (SIG_BLOCK, &fatal_signal_set, NULL);
      |         ^~~~~~~~~~~~~~~
./config.h:728:25: warning: nested extern declaration of 'libtextstyle_pthread_sigmask' [-Wnested-externs]
  728 | #define pthread_sigmask libtextstyle_pthread_sigmask
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../libtextstyle/lib/fatal-signal.c:321:9: note: in expansion of macro 'pthread_sigmask'
  321 |         pthread_sigmask (SIG_BLOCK, &fatal_signal_set, NULL);
      |         ^~~~~~~~~~~~~~~
make[5]: *** [Makefile:4953: libtextstyle_la-fatal-signal.lo] Error 1

With gcc < 14, this was merely a warning.

The cause is a missing declaration of pthread_sigmask after a namespacing
instruction
  #define pthread_sigmask libtextstyle_pthread_sigmask

This patch fixes it.


2026-07-08  Bruno Haible  <[email protected]>

	pthread_sigmask: Avoid compilation error on mingw with gcc >= 14.
	* lib/signal.in.h (pthread_sigmask): Revert 2018-01-04 change, now
	unnecessary due to 2026-04-10 change.

diff --git a/lib/signal.in.h b/lib/signal.in.h
index 9e140ca5e8..236ec7a83c 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -200,7 +200,7 @@ _GL_CXXALIAS_RPL (pthread_sigmask, int,
                    const sigset_t *restrict new_mask,
                    sigset_t *restrict old_mask));
 # else
-#  if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask)
+#  if !@HAVE_PTHREAD_SIGMASK@
 _GL_FUNCDECL_SYS (pthread_sigmask, int,
                   (int how,
                    const sigset_t *restrict new_mask,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.