Rework fix of MinGW build due to Gnulib update

This commit finishes the rework started by reverting changes
to lib/sig2str.h, by adding Emacs-private additions to
signal.h.
* nt/inc/signal.h: New file, defines SIG2STR_MAX and
prototypes of 'sig2str' and 'str2sig'.
This commit is contained in:
Eli Zaretskii 2024-09-06 09:34:20 +03:00
parent 266e321d96
commit 658715c977

39
nt/inc/signal.h Normal file
View file

@ -0,0 +1,39 @@
/* Addition to system header signal.h file for building GNU Emacs on
Windows. It is needed because Posix mandates sig2str should appear
in signal.h, and Gnulib insists on assuming that, and the MinGW build
cannot use Gnulib's signal.h.
Copyright (C) 2024 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _NT_INC_SIGNAL_H_
# define _NT_INC_SIGNAL_H_
/* Maximum size of a signal name returned by sig2str(), including the
terminating NUL byte. Shamelessly stolen from Gnulib. */
# ifndef SIG2STR_MAX
/* The longest one: "RTMAX", then "+" or "-", then up to 10 digits, then NUL.
Add + 2 as a reserve for the future. */
# define SIG2STR_MAX (5 + 1 + 10 + 1 + 2)
# endif
int sig2str (int, char *);
int str2sig (char const *, int *);
# include_next <signal.h>
#endif