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

ruby-changes:57704

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 10 Sep 2019 12:25:57 +0900 (JST)
Subject: [ruby-changes:57704] 20e428ec40 (master): fix CentOS 6 compile error

https://git.ruby-lang.org/ruby.git/commit/?id=20e428ec40

From 20e428ec40ee1c83708b3ade6a0007ab2a435f83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Tue, 10 Sep 2019 12:22:26 +0900
Subject: fix CentOS 6 compile error

See also https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-master/log/20190910T003005Z.fail.html.gz

diff --git a/configure.ac b/configure.ac
index 94e07e7..c2197f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1399,6 +1399,21 @@ AS_IF([test "$rb_cv_func_weak" != x], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1399
    AC_DEFINE(HAVE_FUNC_WEAK)
 ])
 
+AC_CACHE_CHECK([for __attribute__((__depreacted__(msg))) in C++],
+  rb_cv_CentOS6_CXX_workaround,
+  RUBY_WERROR_FLAG([
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+        [],
+        [__attribute__((__deprecated__("message"))) int conftest(...);])],
+      [rb_cv_CentOS6_CXX_workaround=yes],
+      [rb_cv_CentOS6_CXX_workaround=no])
+    AC_LANG_POP()]))
+AS_IF([test "rb_cv_CentOS6_CXX_workaround" != no],[
+  AC_DEFINE([RUBY_CXX_DEPRECATED(msg)],
+    [__attribute__((__deprecated__(msg)))])])
+
 if_i386=${universal_binary+[defined __i386__]}
 RUBY_FUNC_ATTRIBUTE(__stdcall__,  FUNC_STDCALL,  rb_cv_func_stdcall,  ${if_i386})
 RUBY_FUNC_ATTRIBUTE(__cdecl__,    FUNC_CDECL,    rb_cv_func_cdecl,    ${if_i386})
diff --git a/include/ruby/backward/cxxanyargs.hpp b/include/ruby/backward/cxxanyargs.hpp
index 1c36cda..51f7302 100644
--- a/include/ruby/backward/cxxanyargs.hpp
+++ b/include/ruby/backward/cxxanyargs.hpp
@@ -47,7 +47,7 @@ typedef int int_type(ANYARGS); https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L47
 /// @name Hooking global variables
 /// @{
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Define a function-backended global variable.
 /// @param[in]   q  Name of the variable.
 /// @param[in]   w  Getter function.
@@ -63,7 +63,7 @@ rb_define_virtual_variable(const char *q, type *w, void_type *e) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L63
     ::rb_define_virtual_variable(q, r, t);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Define a function-backended global variable.
 /// @param[in]   q  Name of the variable.
 /// @param[in]   w  Variable storage.
@@ -84,7 +84,7 @@ rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L84
 /// @name Exceptions and tag jumps
 /// @{
 
-DEPRECATED_TYPE(("Use rb_block_call instead"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Old way to implement iterators.
 /// @param[in]   q  A function that can yield.
 /// @param[in]   w  Passed to `q`.
@@ -101,7 +101,7 @@ rb_iterate(VALUE(*q)(VALUE), VALUE w, type *e, VALUE r) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L101
     return ::rb_iterate(q, w, t, r);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Call a method with a block.
 /// @param[in]   q  The self.
 /// @param[in]   w  The method.
@@ -119,7 +119,7 @@ rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L119
     return ::rb_block_call(q, w, e, r, u, y);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       An equivalent of `rescue` clause.
 /// @param[in]   q  A function that can raise.
 /// @param[in]   w  Passed to `q`.
@@ -142,7 +142,7 @@ rb_rescue(type *q, VALUE w, type *e, VALUE r) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L142
     return ::rb_rescue(t, w, y, r);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       An equivalent of `rescue` clause.
 /// @param[in]   q    A function that can raise.
 /// @param[in]   w    Passed to `q`.
@@ -169,7 +169,7 @@ rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L169
     va_end(ap);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       An equivalent of `ensure` clause.
 /// @param[in]   q  A function that can raise.
 /// @param[in]   w  Passed to `q`.
@@ -190,7 +190,7 @@ rb_ensure(type *q, VALUE w, type *e, VALUE r) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L190
     return ::rb_ensure(t, w, y, r);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       An equivalent of `Kernel#catch`.
 /// @param[in]   q  The "tag" string.
 /// @param[in]   w  A function that can throw.
@@ -209,7 +209,7 @@ rb_catch(const char *q, type *w, VALUE e) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L209
     return ::rb_catch(q, r, e);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       An equivalent of `Kernel#catch`.
 /// @param[in]   q  The "tag" object.
 /// @param[in]   w  A function that can throw.
@@ -232,7 +232,7 @@ rb_catch_obj(VALUE q, type *w, VALUE e) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L232
 /// @name Procs, Fibers and Threads
 /// @{
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Creates a @ref rb_cFiber instance.
 /// @param[in]   q  The fiber body.
 /// @param[in]   w  Passed to `q`.
@@ -248,7 +248,7 @@ rb_fiber_new(type *q, VALUE w) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L248
     return ::rb_fiber_new(e, w);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Creates a @ref rb_cProc instance.
 /// @param[in]   q  The proc body.
 /// @param[in]   w  Passed to `q`.
@@ -264,7 +264,7 @@ rb_proc_new(type *q, VALUE w) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L264
     return ::rb_proc_new(e, w);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Creates a @ref rb_cThread instance.
 /// @param[in]   q  The thread body.
 /// @param[in]   w  Passed to `q`.
@@ -285,7 +285,7 @@ rb_thread_create(type *q, void *w) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L285
 /// @name Hash and st_table
 /// @{
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Iteration over the given table.
 /// @param[in]   q  A table to scan.
 /// @param[in]   w  A function to iterate.
@@ -303,7 +303,7 @@ st_foreach(st_table *q, int_type *w, st_data_t e) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L303
     return ::st_foreach(q, r, e);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Iteration over the given table.
 /// @param[in]   q  A table to scan.
 /// @param[in]   w  A function to iterate.
@@ -321,7 +321,7 @@ st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L321
     return ::st_foreach_check(q, t, e, 0);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Iteration over the given table.
 /// @param[in]   q  A table to scan.
 /// @param[in]   w  A function to iterate.
@@ -337,7 +337,7 @@ st_foreach_safe(st_table *q, int_type *w, st_data_t e) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L337
     ::st_foreach_safe(q, r, e);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Iteration over the given hash.
 /// @param[in]   q  A hash to scan.
 /// @param[in]   w  A function to iterate.
@@ -353,7 +353,7 @@ rb_hash_foreach(VALUE q, int_type *w, VALUE e) https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/cxxanyargs.hpp#L353
     ::rb_hash_foreach(q, r, e);
 }
 
-DEPRECATED_TYPE(("Use of ANYARGS in this function is deprected"),)
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
 /// @brief       Iteration over each instance variable of the object.
 /// @param[in]   q  An object.
 /// @param[in]   w  A function to iterate.
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 5d890df..72ec11d 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -38,6 +38,9 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L38
 #ifndef DEPRECATED_TYPE
 # define DEPRECATED_TYPE(mesg, decl) decl
 #endif
+#ifndef RUBY_CXX_DEPRECATED
+# define RUBY_CXX_DEPRECATED(mesg) /* nothing */
+#endif
 #ifndef NOINLINE
 # define NOINLINE(x) x
 #endif
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 13463d3..9b3cd4a 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile (... truncated)

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

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