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

ruby-changes:38474

From: nobu <ko1@a...>
Date: Wed, 20 May 2015 13:16:02 +0900 (JST)
Subject: [ruby-changes:38474] nobu:r50555 (trunk): configure.in: attribute arguments

nobu	2015-05-20 13:15:40 +0900 (Wed, 20 May 2015)

  New Revision: 50555

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

  Log:
    configure.in: attribute arguments
    
    * configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
      the macro.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
Index: configure.in
===================================================================
--- configure.in	(revision 50554)
+++ configure.in	(revision 50555)
@@ -1611,7 +1611,7 @@ EOH https://github.com/ruby/ruby/blob/trunk/configure.in#L1611
 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 https://github.com/ruby/ruby/blob/trunk/configure.in#L1619
   [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 \ https://github.com/ruby/ruby/blob/trunk/configure.in#L1632
   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
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50554)
+++ ChangeLog	(revision 50555)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May 20 13:14:30 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
+	  the macro.
+
 Wed May 20 11:23:24 2015  NARUSE, Yui  <naruse@r...>
 
 	* vm_dump.c (rb_print_backtrace): return value of libexec's backtrace

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

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