1#ifndef RUBY_BACKWARD2_ATTRIBUTES_H
2#define RUBY_BACKWARD2_ATTRIBUTES_H
30#include "ruby/internal/config.h"
51#define CONSTFUNC(x) RBIMPL_ATTR_CONST() x
54#define PUREFUNC(x) RBIMPL_ATTR_PURE() x
57#define DEPRECATED(x) RBIMPL_ATTR_DEPRECATED(("")) x
60#define DEPRECATED_BY(n,x) RBIMPL_ATTR_DEPRECATED(("by: " # n)) x
64# define DEPRECATED_TYPE(mesg, decl) \
65 _Pragma("message \"DEPRECATED_TYPE is deprecated\""); \
66 decl RBIMPL_ATTR_DEPRECATED(mseg)
67#elif defined(_MSC_VER)
68# pragma deprecated(DEPRECATED_TYPE)
69# define DEPRECATED_TYPE(mesg, decl) \
70 __pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: " \
71 "DEPRECATED_TYPE is deprecated")) \
72 decl RBIMPL_ATTR_DEPRECATED(mseg)
74# define DEPRECATED_TYPE(mesg, decl) \
75 <-<-"DEPRECATED_TYPE is deprecated"->->
78#undef RUBY_CXX_DEPRECATED
79#define RUBY_CXX_DEPRECATED(mseg) RBIMPL_ATTR_DEPRECATED((mseg))
82#define NOINLINE(x) RBIMPL_ATTR_NOINLINE() x
85#define ALWAYS_INLINE(x) RBIMPL_ATTR_FORCEINLINE() x
88#define ERRORFUNC(mesg, x) RBIMPL_ATTR_ERROR(mesg) x
89#if RBIMPL_HAS_ATTRIBUTE(error)
90# define HAVE_ATTRIBUTE_ERRORFUNC 1
94#define WARNINGFUNC(mesg, x) RBIMPL_ATTR_WARNING(mesg) x
95#if RBIMPL_HAS_ATTRIBUTE(warning)
96# define HAVE_ATTRIBUTE_WARNINGFUNC 1
104#define COLDFUNC RBIMPL_ATTR_COLD()
106#define PRINTF_ARGS(decl, string_index, first_to_check) \
107 RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, (string_index), (first_to_check)) \
110#undef RUBY_ATTR_ALLOC_SIZE
111#define RUBY_ATTR_ALLOC_SIZE RBIMPL_ATTR_ALLOC_SIZE
113#undef RUBY_ATTR_MALLOC
114#define RUBY_ATTR_MALLOC RBIMPL_ATTR_RESTRICT()
116#undef RUBY_ATTR_RETURNS_NONNULL
117#define RUBY_ATTR_RETURNS_NONNULL RBIMPL_ATTR_RETURNS_NONNULL()
119#ifndef FUNC_MINIMIZED
120#define FUNC_MINIMIZED(x) x
123#ifndef FUNC_UNOPTIMIZED
124#define FUNC_UNOPTIMIZED(x) x
127#ifndef RUBY_ALIAS_FUNCTION_TYPE
128#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \
129 FUNC_MINIMIZED(type prot) {return (type)name args;}
132#ifndef RUBY_ALIAS_FUNCTION_VOID
133#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
134 FUNC_MINIMIZED(void prot) {name args;}
137#ifndef RUBY_ALIAS_FUNCTION
138#define RUBY_ALIAS_FUNCTION(prot, name, args) \
139 RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
142#undef RUBY_FUNC_NONNULL
143#define RUBY_FUNC_NONNULL(n, x) RBIMPL_ATTR_NONNULL(n) x
146#define NORETURN(x) RBIMPL_ATTR_NORETURN() x
147#define NORETURN_STYLE_NEW
150#define PACKED_STRUCT(x) \
151 RBIMPL_ATTR_PACKED_STRUCT_BEGIN() x RBIMPL_ATTR_PACKED_STRUCT_END()
153#undef PACKED_STRUCT_UNALIGNED
154#define PACKED_STRUCT_UNALIGNED(x) \
155 RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN() x \
156 RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END()
159#define RB_UNUSED_VAR(x) x RBIMPL_ATTR_MAYBE_UNUSED()
Defines RBIMPL_ATTR_ALLOC_SIZE.
Defines RBIMPL_ATTR_WARNING.
Defines RBIMPL_HAS_ATTRIBUTE.
Defines RBIMPL_ATTR_COLD.
Defines RBIMPL_ATTR_CONST.
Defines RBIMPL_ATTR_DEPRECATED.
Defines RBIMPL_ATTR_FORCEINLINE.
Defines RBIMPL_ATTR_ERROR.
Defines RBIMPL_ATTR_MAYBE_UNUSED.
Defines RBIMPL_ATTR_NOINLINE.
Defines RBIMPL_ATTR_NONNULL.
Defines RBIMPL_ATTR_NORETURN.
Defines RBIMPL_ATTR_PACKED_STRUCT_BEGIN, RBIMPL_ATTR_PACKED_STRUCT_END, RBIMPL_ATTR_PACKED_STRUCT_UNA...
Defines RBIMPL_ATTR_PURE.
Defines RBIMPL_ATTR_RESTRICT.
Defines RBIMPL_ATTR_RETURNS_NONNULL.