diff --git a/configure.ac b/configure.ac index 37b4c53815..a6734dfafb 100644 --- a/configure.ac +++ b/configure.ac @@ -1505,7 +1505,6 @@ RUBY_FUNC_ATTRIBUTE(__pure__, PUREFUNC) RUBY_FUNC_ATTRIBUTE(__noreturn__, NORETURN) RUBY_FUNC_ATTRIBUTE(__deprecated__, DEPRECATED) RUBY_FUNC_ATTRIBUTE(__deprecated__("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by) -RUBY_TYPE_ATTRIBUTE(__deprecated__ mesg, DEPRECATED_TYPE(mesg,x), rb_cv_type_deprecated) RUBY_FUNC_ATTRIBUTE(__noinline__, NOINLINE) RUBY_FUNC_ATTRIBUTE(__always_inline__, ALWAYS_INLINE) RUBY_FUNC_ATTRIBUTE(__no_sanitize__(san), NO_SANITIZE(san, x), rb_cv_func_no_sanitize) diff --git a/include/ruby/backward/2/attributes.h b/include/ruby/backward/2/attributes.h index 8d00da0a9e..74dca627fb 100644 --- a/include/ruby/backward/2/attributes.h +++ b/include/ruby/backward/2/attributes.h @@ -60,7 +60,23 @@ #define DEPRECATED_BY(n,x) RBIMPL_ATTR_DEPRECATED(("by: " # n)) x #undef DEPRECATED_TYPE -#define DEPRECATED_TYPE(mseg, decl) decl RBIMPL_ATTR_DEPRECATED(mseg) +#if defined(__GNUC__) +# define DEPRECATED_TYPE(mesg, decl) \ + _Pragma("message \"DEPRECATED_TYPE is deprecated, " \ + "use RBIMPL_ATTR_DEPRECATED instead\""); \ + decl RBIMPL_ATTR_DEPRECATED(mseg) +#elif defined(_MSC_VER) +# pragma deprecated(DEPRECATED_TYPE) +# define DEPRECATED_TYPE(mesg, decl) \ + __pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: " \ + "DEPRECATED_TYPE is deprecated, " \ + "use RBIMPL_ATTR_DEPRECATED instead")) \ + decl RBIMPL_ATTR_DEPRECATED(mseg) +#else +# define DEPRECATED_TYPE(mesg, decl) \ + <-<-"DEPRECATED_TYPE is deprecated, " \ + "use RBIMPL_ATTR_DEPRECATED instead"->-> +#endif #undef RUBY_CXX_DEPRECATED #define RUBY_CXX_DEPRECATED(mseg) RBIMPL_ATTR_DEPRECATED((mseg)) diff --git a/template/Doxyfile.tmpl b/template/Doxyfile.tmpl index 54734748a3..4f6c432871 100644 --- a/template/Doxyfile.tmpl +++ b/template/Doxyfile.tmpl @@ -225,7 +225,6 @@ PREDEFINED = \ CONSTFUNC(_)=_ \ DEPRECATED(_)=_ \ DEPRECATED_BY(__,_)=_ \ - DEPRECATED_TYPE(__,_)=_ \ ERRORFUNC(__,_)=_ \ MJIT_FUNC_EXPORTED= \ MJIT_STATIC=extern \ diff --git a/win32/Makefile.sub b/win32/Makefile.sub index df85095ddf..87cda5f9e4 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -699,7 +699,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub !endif !if $(MSC_VER) >= 1300 #define DEPRECATED(x) __declspec(deprecated) x -#define DEPRECATED_TYPE(mesg, x) __declspec(deprecated mesg) x #define RUBY_CXX_DEPRECATED(mesg) __declspec(deprecated(mesg)) #define NOINLINE(x) __declspec(noinline) x !endif