1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2015-05-20 04:15:40 +00:00
parent 50732b7b6e
commit 814b83918e
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Wed May 20 13:14:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
the macro.
Wed May 20 11:23:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
* vm_dump.c (rb_print_backtrace): return value of libexec's backtrace

View file

@ -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