public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Make SIG2STR_MAX usable in #if
@ 2023-06-21 13:20 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-06-21 13:20 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6b2ae32ecdfdb8ca1337e19fac3b6e0a4079e769
commit 6b2ae32ecdfdb8ca1337e19fac3b6e0a4079e769
Author: Mingye Wang <arthur200126@gmail.com>
AuthorDate: Wed Jun 21 20:11:57 2023 +0800
Commit: Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Jun 21 15:15:03 2023 +0200
Make SIG2STR_MAX usable in #if
The text accepted for POSIX issue 8 requires that SIG2STR_MAX be usable
in #if, which we currently break with sizeof. Use static values instead.
Diff:
---
newlib/libc/include/sys/signal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h
index 8dc5fb9c34fc..96bf9781ae93 100644
--- a/newlib/libc/include/sys/signal.h
+++ b/newlib/libc/include/sys/signal.h
@@ -245,9 +245,9 @@ int sigqueue (pid_t, int, const union sigval);
/* POSIX Issue 8 adds sig2str() and str2sig() */
#if __SIZEOF_INT__ >= 4
-#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("4294967295") - 1)
+#define SIG2STR_MAX 17 /* (sizeof("RTMAX+") + sizeof("4294967295") - 1) */
#else
-#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("65535") - 1)
+#define SIG2STR_MAX 12 /* (sizeof("RTMAX+") + sizeof("65535") - 1) */
#endif
int sig2str(int, char *);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-21 13:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 13:20 [newlib-cygwin/main] Make SIG2STR_MAX usable in #if Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).