Ruby: include/ruby/internal/attr/deprecated.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

deprecated.h
Go to the documentation of this file.
1#ifndef RBIMPL_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ATTR_DEPRECATED_H
23#include "ruby/internal/compiler_since.h"
24#include "ruby/internal/has/attribute.h"
25#include "ruby/internal/has/c_attribute.h"
26#include "ruby/internal/has/cpp_attribute.h"
27#include "ruby/internal/has/declspec_attribute.h"
28#include "ruby/internal/has/extension.h"
29
31#if RBIMPL_HAS_EXTENSION(attribute_deprecated_with_message)
32# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
33
34#elif defined(__cplusplus) && RBIMPL_COMPILER_SINCE(GCC, 10, 1, 0) /* && RBIMPL_COMPILER_BEFORE(GCC, 10, X, Y) */
35# /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95302 */
36# define RBIMPL_ATTR_DEPRECATED(msg) /* disable until they fix this bug */
37
38#elif RBIMPL_COMPILER_SINCE(GCC, 4, 5, 0)
39# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
40
41#elif RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
42# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
43
44#elif RBIMPL_HAS_ATTRIBUTE(deprecated) /* but not with message. */
45# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__))
46
47#elif RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
48# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated msg)
49
50#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(deprecated)
51# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated)
52
53#elif RBIMPL_HAS_CPP_ATTRIBUTE(deprecated)
54# define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]]
55
56#elif RBIMPL_HAS_C_ATTRIBUTE(deprecated)
57# define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]]
58
59#else
60# define RBIMPL_ATTR_DEPRECATED(msg) /* void */
61#endif
62
63#endif /* RBIMPL_ATTR_DEPRECATED_H */
attribute.h
Defines RBIMPL_HAS_ATTRIBUTE.
c_attribute.h
Defines RBIMPL_HAS_C_ATTRIBUTE.
compiler_since.h
Defines RBIMPL_COMPILER_SINCE.
cpp_attribute.h
Defines RBIMPL_HAS_CPP_ATTRIBUTE.
declspec_attribute.h
Defines RBIMPL_HAS_DECLSPEC_ATTRIBUTE.
extension.h
Defines RBIMPL_HAS_EXTENSION.