From 7dc4bbc1406202a48ef31e9fb97d542ece4d5519 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 13 Dec 2014 08:59:54 +0000 Subject: configure.in: rb_cv_mcontext_t_ptr * configure.in (rb_cv_mcontext_t_ptr): abstract whether mcontext_t is a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index ce9939cdd9..5f7ae53153 100644 --- a/configure.in +++ b/configure.in @@ -2712,6 +2712,17 @@ if test x"$enable_pthread" = xyes; then fi fi if test x"$ac_cv_header_ucontext_h" = xyes; then + AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr], + [AC_TRY_COMPILE([@%:@include + mcontext_t test(mcontext_t mc) {return mc+1;} + ], + [test(0);], + [rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])]) + if test x"$rb_cv_mcontext_t_ptr" = xyes; then + AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext) + else + AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->uc_mcontext) + fi if test x"$rb_with_pthread" = xyes; then AC_CHECK_FUNCS(getcontext setcontext) fi -- cgit v1.2.3