Skip to content

Commit

Permalink
DEPRECATED_TYPE: is deprecated
Browse files Browse the repository at this point in the history
Nobody uses this macro any longer.
  • Loading branch information
shyouhei committed Aug 27, 2020
1 parent 3437e62 commit 21b3bc1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 0 additions & 1 deletion configure.ac
Expand Up @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion include/ruby/backward/2/attributes.h
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion template/Doxyfile.tmpl
Expand Up @@ -225,7 +225,6 @@ PREDEFINED = \
CONSTFUNC(_)=_ \
DEPRECATED(_)=_ \
DEPRECATED_BY(__,_)=_ \
DEPRECATED_TYPE(__,_)=_ \
ERRORFUNC(__,_)=_ \
MJIT_FUNC_EXPORTED= \
MJIT_STATIC=extern \
Expand Down
1 change: 0 additions & 1 deletion win32/Makefile.sub
Expand Up @@ -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
Expand Down

0 comments on commit 21b3bc1

Please sign in to comment.