[前][次][番号順一覧][スレッド一覧]

ruby-changes:52947

From: shyouhei <ko1@a...>
Date: Fri, 19 Oct 2018 12:33:52 +0900 (JST)
Subject: [ruby-changes:52947] shyouhei:r65161 (trunk): vm_core.h: NSIG is a BSDism.

shyouhei	2018-10-19 12:33:48 +0900 (Fri, 19 Oct 2018)

  New Revision: 65161

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65161

  Log:
    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

  Modified files:
    trunk/vm_core.h
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 65160)
+++ vm_core.h	(revision 65161)
@@ -86,8 +86,18 @@ https://github.com/ruby/ruby/blob/trunk/vm_core.h#L86
 #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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]