aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.in7
-rw-r--r--cont.c5
-rw-r--r--win32/Makefile.sub3
4 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ff0601f8e..46afa32836 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 7 21:03:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in, win32/Makefile.sub (FIBER_USE_NATIVE): move conditions
+ from cont.c
+
Mon Oct 7 20:29:31 2013 Zachary Scott <e@zzak.io>
* lib/time.rb: [DOC] typo in Time.rb overview by @srt32 [Fixes GH-416]
diff --git a/configure.in b/configure.in
index c23f691325..03d08386a1 100644
--- a/configure.in
+++ b/configure.in
@@ -2355,6 +2355,13 @@ fi
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
+ [AC_DEFINE(FIBER_USE_NATIVE, 1)])
+ fi
fi
fi
diff --git a/cont.c b/cont.c
index 40aa2731d5..75fa3d5418 100644
--- a/cont.c
+++ b/cont.c
@@ -15,9 +15,6 @@
#include "gc.h"
#include "eval_intern.h"
-#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || (defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT))) && !defined(__NetBSD__) && !defined(__sun) && !defined(__ia64) && !defined(FIBER_USE_NATIVE)
-#define FIBER_USE_NATIVE 1
-
/* FIBER_USE_NATIVE enables Fiber performance improvement using system
* dependent method such as make/setcontext on POSIX system or
* CreateFiber() API on Windows.
@@ -34,7 +31,7 @@
* are represented by stack pointer (higher bits of stack pointer).
* TODO: check such constraint on configure.
*/
-#elif !defined(FIBER_USE_NATIVE)
+#if !defined(FIBER_USE_NATIVE)
#define FIBER_USE_NATIVE 0
#endif
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index d10e82986c..519dc8cd51 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -692,6 +692,9 @@ $(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"