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

ruby-changes:33465

From: akr <ko1@a...>
Date: Thu, 10 Apr 2014 08:16:14 +0900 (JST)
Subject: [ruby-changes:33465] akr:r45544 (trunk): * signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h

akr	2014-04-10 08:16:10 +0900 (Thu, 10 Apr 2014)

  New Revision: 45544

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45544

  Log:
    * signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h
      is not available.
      Fixes build on Android (x86).

  Modified files:
    trunk/ChangeLog
    trunk/signal.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45543)
+++ ChangeLog	(revision 45544)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Apr 10 08:13:47 2014  Tanaka Akira  <akr@f...>
+
+	* signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h
+	  is not available.
+	  Fixes build on Android (x86).
+
 Wed Apr  9 23:22:44 2014  Tanaka Akira  <akr@f...>
 
 	* gc.c (mark_current_machine_context): Call SET_STACK_END.
Index: signal.c
===================================================================
--- signal.c	(revision 45543)
+++ signal.c	(revision 45544)
@@ -636,7 +636,7 @@ rb_get_next_signal(void) https://github.com/ruby/ruby/blob/trunk/signal.c#L636
 
 #if defined(USE_SIGALTSTACK) || defined(_WIN32)
 NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th));
-#if defined __linux__ && (defined __i386__ || defined __x86_64__)
+#if defined(HAVE_UCONTEXT_H) && defined __linux__ && (defined __i386__ || defined __x86_64__)
 static void
 check_stack_overflow(const uintptr_t addr, const ucontext_t *ctx)
 {
@@ -665,7 +665,7 @@ check_stack_overflow(const void *addr) https://github.com/ruby/ruby/blob/trunk/signal.c#L665
 #define CHECK_STACK_OVERFLOW() check_stack_overflow(0)
 #else
 #define FAULT_ADDRESS info->si_addr
-#if defined __linux__ && (defined __i386__ || defined __x86_64__)
+#if defined(HAVE_UCONTEXT_H) && defined __linux__ && (defined __i386__ || defined __x86_64__)
 # define CHECK_STACK_OVERFLOW() check_stack_overflow((uintptr_t)FAULT_ADDRESS, ctx)
 #else
 # define CHECK_STACK_OVERFLOW() check_stack_overflow(FAULT_ADDRESS)

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

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