diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-19 03:33:48 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-19 03:33:48 +0000 |
commit | 00c9a6188bb457989e4cd842e7317c14df6d9a7a (patch) | |
tree | caf1270812643f1bc48e58d377354a500fccd931 /vm_core.h | |
parent | ad564b87ad0f0a6a022365e2c3d3c0d849109567 (diff) |
vm_core.h: NSIG is a BSDism.
Surprisingly, this constant (been there since around 1983) has
never been a part of any standards until now. We have to find
out the appropriate value.
NSIG_MAX is expected to become a part of forthcoming POSIX.
See: http://austingroupbugs.net/view.php?id=741
_SIG_MAXSIG is here because that is greater than NSIG. See
Python's relevant discussion: https://bugs.python.org/issue20584
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -86,8 +86,18 @@ #include <setjmp.h> #include <signal.h> -#ifndef NSIG -# define NSIG (_SIGMAX + 1) /* For QNX */ +#if defined(NSIG_MAX) /* POSIX issue 8 */ +# undef NSIG +# define NSIG NSIG_MAX +#elif defined(_SIG_MAXSIG) /* FreeBSD */ +# undef NSIG +# define NSIG _SIG_MAXSIG +#elif defined(_SIGMAX) /* QNX */ +# define NSIG (_SIGMAX + 1) +#elif defined(NSIG) /* 99% of everything else */ +# /* take it */ +#else /* Last resort */ +# define NSIG (sizeof(sigset_t) * CHAR_BIT + 1) #endif #define RUBY_NSIG NSIG |