summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
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