1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

cont.c: split conditions

* cont.c (FIBER_USE_NATIVE): split long conditions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-10-07 13:45:31 +00:00
parent 9e3eb50212
commit 3bb86ae462
4 changed files with 17 additions and 18 deletions

View file

@ -1,7 +1,6 @@
Mon Oct 7 21:03:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Oct 7 22:45:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in, win32/Makefile.sub (FIBER_USE_NATIVE): move conditions
from cont.c
* cont.c (FIBER_USE_NATIVE): split long conditions.
Mon Oct 7 20:29:31 2013 Zachary Scott <e@zzak.io>

View file

@ -2352,23 +2352,11 @@ if test x"$enable_pthread" = xyes; then
AC_CHECK_FUNCS(pthread_attr_init)
fi
fi
FIBER_USE_NATIVE=0
if test x"$ac_cv_header_ucontext_h" = xyes; then
if test x"$rb_with_pthread" = xyes; then
AC_CHECK_FUNCS(getcontext setcontext)
if test x"$ac_cv_func_getcontext" = xyes -a x"$ac_cv_func_setcontext" = xyes; then
AS_CASE("$target_cpu-$target_os",
[*-netbsd*], [],
[ia64-*], [], # r38766
[*-sunos*|*-solaris*], [], # r32408
[FIBER_USE_NATIVE=1])
fi
fi
else
AS_CASE("$target_os", [mingw*|mswin*],
[test "[$[with_winnt_ver]]" -ge [$[0x0400]] && FIBER_USE_NATIVE=1])
fi
AC_DEFINE(FIBER_USE_NATIVE)
if test "$ac_cv_func_fork" = "yes" -a "$rb_with_pthread" = "yes"; then
AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,

15
cont.c
View file

@ -15,6 +15,20 @@
#include "gc.h"
#include "eval_intern.h"
#if !defined(FIBER_USE_NATIVE)
# if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
# if defined(__NetBSD__)
# elif defined(__sun)
# elif defined(__ia64)
# else
# define FIBER_USE_NATIVE 1
# endif
# elif defined(_WIN32)
# if _WIN32_WINNT >= 0x0400
# define FIBER_USE_NATIVE 1
# endif
# endif
/* FIBER_USE_NATIVE enables Fiber performance improvement using system
* dependent method such as make/setcontext on POSIX system or
* CreateFiber() API on Windows.
@ -31,6 +45,7 @@
* are represented by stack pointer (higher bits of stack pointer).
* TODO: check such constraint on configure.
*/
#endif
#if !defined(FIBER_USE_NATIVE)
#define FIBER_USE_NATIVE 0
#endif

View file

@ -692,9 +692,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
!if "$(MACHINE)" == "x86" || "$(ARCH)" == "x64" || "$(ARCH)" == "ia64"
#define STACK_GROW_DIRECTION -1
!endif
!if "$(ARCH)" != "ia64" && NTVER >= 0x0400 # r27646
#define FIBER_USE_NATIVE 1
!endif
#define CANONICALIZATION_FOR_MATHN 1
#define DEFAULT_KCODE KCODE_NONE
!if "$(ENABLE_DEBUG_ENV)" == "yes"