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.
This commit is contained in:
Mingye Wang 2023-06-21 20:11:57 +08:00 committed by Corinna Vinschen
parent 6604db8b80
commit 6b2ae32ecd
1 changed files with 2 additions and 2 deletions

View File

@ -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 *);