From 3bb86ae462ab411471f6f24d2cc967e0e9acdc84 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 7 Oct 2013 13:45:31 +0000 Subject: 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 --- ChangeLog | 5 ++--- configure.in | 12 ------------ cont.c | 15 +++++++++++++++ win32/Makefile.sub | 3 --- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46afa32836..d8bc414359 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,6 @@ -Mon Oct 7 21:03:54 2013 Nobuyoshi Nakada +Mon Oct 7 22:45:20 2013 Nobuyoshi Nakada - * 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 diff --git a/configure.in b/configure.in index 04bdbb926c..c23f691325 100644 --- a/configure.in +++ b/configure.in @@ -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, diff --git a/cont.c b/cont.c index 75fa3d5418..d09b21bb31 100644 --- a/cont.c +++ b/cont.c @@ -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 diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 519dc8cd51..d10e82986c 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -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" -- cgit v1.2.3