From 814b83918e1628d0293b72a20d7147d07a17d1f1 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 20 May 2015 04:15:40 +0000 Subject: [PATCH] configure.in: attribute arguments * configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in the macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ configure.in | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 800aebfd44..7287c99c81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 20 13:14:30 2015 Nobuyoshi Nakada + + * configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in + the macro. + Wed May 20 11:23:24 2015 NARUSE, Yui * vm_dump.c (rb_print_backtrace): return value of libexec's backtrace diff --git a/configure.in b/configure.in index f75d97e0ca..64201e4a86 100644 --- a/configure.in +++ b/configure.in @@ -1611,7 +1611,7 @@ EOH dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition) AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl m4_ifval([$2], dnl - [AS_VAR_PUSHDEF([attrib],[$2])], dnl + [AS_VAR_PUSHDEF([attrib], m4_bpatsubst([$2], [(.*)], []))], dnl [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl )dnl m4_ifval([$3], dnl @@ -1619,8 +1619,9 @@ m4_ifval([$3], dnl [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl )dnl m4_pushdef([attrib_code],[m4_bpatsubst([$1],["],[\\"])])dnl +m4_pushdef([attrib_params],[m4_bpatsubst([$2(x)],[^[^()]*(\([^()]*\)).*],[\1])])dnl m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond]) -AC_CACHE_CHECK(for m4_ifval([$2],[$2],[$1]) function attribute, rbcv, +AC_CACHE_CHECK(for m4_ifval([$2],[m4_bpatsubst([$2], [(.*)], [])],[$1]) function attribute, rbcv, dnl [rbcv=x RUBY_WERROR_FLAG([ for mac in \ @@ -1631,18 +1632,20 @@ for mac in \ m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"}) AC_TRY_COMPILE( m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond}) -[@%:@define ]attrib[(x) $mac] +[@%:@define ]attrib[](attrib_params)[ $mac] m4_ifval([$4],${rbcv_cond+[@%:@else]} -${rbcv_cond+[@%:@define ]attrib[(x) x]} +${rbcv_cond+[@%:@define ]attrib[](attrib_params)[ x]} ${rbcv_cond+[@%:@endif]}) - attrib[(void conftest_attribute_check(void));], [], +[@%:@define x void conftest_attribute_check(void)] + attrib[](attrib_params)[;], [], [rbcv="$mac"; break]) done ])]) if test "$rbcv" != x; then - RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv) + RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[](attrib_params)[], $rbcv) fi m4_ifval([$4], [unset rbcv_cond]) dnl +m4_popdef([attrib_params])dnl m4_popdef([attrib_code])dnl AS_VAR_POPDEF([attrib])dnl AS_VAR_POPDEF([rbcv])dnl