summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-19 03:33:48 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-19 03:33:48 +0000
commit00c9a6188bb457989e4cd842e7317c14df6d9a7a (patch)
treecaf1270812643f1bc48e58d377354a500fccd931 /vm_core.h
parentad564b87ad0f0a6a022365e2c3d3c0d849109567 (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.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/vm_core.h b/vm_core.h
index 78de294b07..9716aff3fc 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -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