From 431dc5c8b531f4ab67d70ea899f9837d2b10e840 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 19 Sep 2014 02:01:15 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index f6dfd977eb..3d6e45bc4f 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -531,6 +531,13 @@ void rb_check_safe_obj(VALUE); 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 {\