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

ruby-changes:35554

From: nobu <ko1@a...>
Date: Fri, 19 Sep 2014 11:01:22 +0900 (JST)
Subject: [ruby-changes:35554] nobu:r47636 (trunk): ruby.h: err rb_check_safe_str explicitly

nobu	2014-09-19 11:01:15 +0900 (Fri, 19 Sep 2014)

  New Revision: 47636

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

  Log:
    ruby.h: err rb_check_safe_str explicitly
    
    * include/ruby/ruby.h (rb_check_safe_str, Check_SafeStr): show
      error message to update for obsolete function and macro.

  Modified files:
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 47635)
+++ include/ruby/ruby.h	(revision 47636)
@@ -531,6 +531,13 @@ void rb_check_safe_obj(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L531
     StringValue(v);\
     rb_check_safe_obj(v);\
 } while (0)
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+void rb_check_safe_str(VALUE) __attribute__((error("rb_check_safe_str() and Check_SafeStr() are obsolete; use SafeStringValue() instead")));
+# define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
+#else
+# define rb_check_safe_str(x) [<"rb_check_safe_str() is obsolete; use SafeStringValue() instead">]
+# define Check_SafeStr(v) [<"Check_SafeStr() is obsolete; use SafeStringValue() instead">]
+#endif
 
 VALUE rb_str_export(VALUE);
 #define ExportStringValue(v) do {\

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

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