diff options
| author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-05-04 15:52:56 +0900 |
|---|---|---|
| committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-05-11 09:24:08 +0900 |
| commit | 97672f669af53c41b094772559030195787406be (patch) | |
| tree | 71902d58cda65825046cff5e42723dfa0d0280af /include/ruby/impl/attr | |
| parent | d7f4d732c199df24620a162372c71ee83ed21e62 (diff) | |
sed -i s/RUBY3/RBIMPL/g
Devs do not love "3". The only exception is RUBY3_KEYWORDS in parse.y,
which seems unrelated to our interests.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
Diffstat (limited to 'include/ruby/impl/attr')
24 files changed, 293 insertions, 293 deletions
diff --git a/include/ruby/impl/attr/alloc_size.h b/include/ruby/impl/attr/alloc_size.h index 4d514ca00e..e48a8db5d2 100644 --- a/include/ruby/impl/attr/alloc_size.h +++ b/include/ruby/impl/attr/alloc_size.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_ALLOC_SIZE_H +#ifndef RBIMPL_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_ALLOC_SIZE_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,15 +18,15 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_ALLOC_SIZE. + * @brief Defines #RBIMPL_ATTR_ALLOC_SIZE. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((alloc_size))` */ -#if RUBY3_HAS_ATTRIBUTE(alloc_size) -# define RUBY3_ATTR_ALLOC_SIZE(tuple) __attribute__((__alloc_size__ tuple)) +#if RBIMPL_HAS_ATTRIBUTE(alloc_size) +# define RBIMPL_ATTR_ALLOC_SIZE(tuple) __attribute__((__alloc_size__ tuple)) #else -# define RUBY3_ATTR_ALLOC_SIZE(tuple) /* void */ +# define RBIMPL_ATTR_ALLOC_SIZE(tuple) /* void */ #endif -#endif /* RUBY3_ATTR_ALLOC_SIZE_H */ +#endif /* RBIMPL_ATTR_ALLOC_SIZE_H */ diff --git a/include/ruby/impl/attr/artificial.h b/include/ruby/impl/attr/artificial.h index e33d536e3d..a20c6e5d94 100644 --- a/include/ruby/impl/attr/artificial.h +++ b/include/ruby/impl/attr/artificial.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_ARTIFICIAL_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_ARTIFICIAL_H +#ifndef RBIMPL_ATTR_ARTIFICIAL_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_ARTIFICIAL_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_ARTIFICIAL. + * @brief Defines #RBIMPL_ATTR_ARTIFICIAL. * * ### Q&A ### * @@ -37,10 +37,10 @@ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((artificial))` */ -#if RUBY3_HAS_ATTRIBUTE(artificial) -# define RUBY3_ATTR_ARTIFICIAL() __attribute__((__artificial__)) +#if RBIMPL_HAS_ATTRIBUTE(artificial) +# define RBIMPL_ATTR_ARTIFICIAL() __attribute__((__artificial__)) #else -# define RUBY3_ATTR_ARTIFICIAL() /* void */ +# define RBIMPL_ATTR_ARTIFICIAL() /* void */ #endif -#endif /* RUBY3_ATTR_ARTIFICIAL_H */ +#endif /* RBIMPL_ATTR_ARTIFICIAL_H */ diff --git a/include/ruby/impl/attr/cold.h b/include/ruby/impl/attr/cold.h index ed50a5e266..925f0efce0 100644 --- a/include/ruby/impl/attr/cold.h +++ b/include/ruby/impl/attr/cold.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_COLD_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_COLD_H +#ifndef RBIMPL_ATTR_COLD_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_COLD_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,20 +18,20 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_COLD. + * @brief Defines #RBIMPL_ATTR_COLD. */ #include "ruby/impl/compiler_is.h" #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((cold))` */ -#if RUBY3_COMPILER_IS(SunPro) +#if RBIMPL_COMPILER_IS(SunPro) # /* Recent SunPro has __has_attribute, and is borken. */ # /* It reports it has attribute cold, reality isn't (warnings issued). */ -# define RUBY3_ATTR_COLD() /* void */ -#elif RUBY3_HAS_ATTRIBUTE(cold) -# define RUBY3_ATTR_COLD() __attribute__((__cold__)) +# define RBIMPL_ATTR_COLD() /* void */ +#elif RBIMPL_HAS_ATTRIBUTE(cold) +# define RBIMPL_ATTR_COLD() __attribute__((__cold__)) #else -# define RUBY3_ATTR_COLD() /* void */ +# define RBIMPL_ATTR_COLD() /* void */ #endif -#endif /* RUBY3_ATTR_COLD_H */ +#endif /* RBIMPL_ATTR_COLD_H */ diff --git a/include/ruby/impl/attr/const.h b/include/ruby/impl/attr/const.h index 7054b916ac..c2d70bef7e 100644 --- a/include/ruby/impl/attr/const.h +++ b/include/ruby/impl/attr/const.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_CONST_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_CONST_H +#ifndef RBIMPL_ATTR_CONST_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_CONST_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,29 +18,29 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_CONST. + * @brief Defines #RBIMPL_ATTR_CONST. */ #include "ruby/impl/compiler_since.h" #include "ruby/impl/has/attribute.h" #include "ruby/impl/has/declspec_attribute.h" /** Wraps (or simulates) `__attribute__((const))` */ -#if RUBY3_HAS_ATTRIBUTE(const) -# define RUBY3_ATTR_CONST() __attribute__((__const__)) -#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias) +#if RBIMPL_HAS_ATTRIBUTE(const) +# define RBIMPL_ATTR_CONST() __attribute__((__const__)) +#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias) # /* If a function can be a const, that is also a noalias. */ -# define RUBY3_ATTR_CONST() __declspec(noalias) -#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_ATTR_CONST() _Pragma("no_side_effect") +# define RBIMPL_ATTR_CONST() __declspec(noalias) +#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0) +# define RBIMPL_ATTR_CONST() _Pragma("no_side_effect") #else -# define RUBY3_ATTR_CONST() /* void */ +# define RBIMPL_ATTR_CONST() /* void */ #endif -/** Enables #RUBY3_ATTR_CONST iff. #RUBY_NDEBUG. */ +/** Enables #RBIMPL_ATTR_CONST iff. #RUBY_NDEBUG. */ #if RUBY_NDEBUG -# define RUBY3_ATTR_CONST_ON_NDEBUG() RUBY3_ATTR_CONST() +# define RBIMPL_ATTR_CONST_ON_NDEBUG() RBIMPL_ATTR_CONST() #else -# define RUBY3_ATTR_CONST_ON_NDEBUG() /* void */ +# define RBIMPL_ATTR_CONST_ON_NDEBUG() /* void */ #endif -#endif /* RUBY3_ATTR_CONST_H */ +#endif /* RBIMPL_ATTR_CONST_H */ diff --git a/include/ruby/impl/attr/constexpr.h b/include/ruby/impl/attr/constexpr.h index 695ee85c9c..206ec900e1 100644 --- a/include/ruby/impl/attr/constexpr.h +++ b/include/ruby/impl/attr/constexpr.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_CONSTEXPR_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_CONSTEXPR_H +#ifndef RBIMPL_ATTR_CONSTEXPR_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_CONSTEXPR_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief #RUBY3_ATTR_CONSTEXPR. + * @brief #RBIMPL_ATTR_CONSTEXPR. */ #include "ruby/impl/has/feature.h" #include "ruby/impl/compiler_is.h" @@ -27,59 +27,59 @@ /** @cond INTERNAL_MACRO */ #if ! defined(__cplusplus) # /* Makes no sense. */ -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 0 -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 0 +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 0 +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0 #elif defined(__cpp_constexpr) # /* https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations */ -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 (__cpp_constexpr >= 200704L) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 (__cpp_constexpr >= 201304L) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cpp_constexpr >= 200704L) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cpp_constexpr >= 201304L) -#elif RUBY3_COMPILER_SINCE(MSVC, 19, 0, 0) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 RUBY3_COMPILER_SINCE(MSVC, 19, 00, 00) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 RUBY3_COMPILER_SINCE(MSVC, 19, 11, 00) +#elif RBIMPL_COMPILER_SINCE(MSVC, 19, 0, 0) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 00) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 00) -#elif RUBY3_COMPILER_SINCE(SunPro, 5, 13, 0) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L) +#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 13, 0) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L) -#elif RUBY3_COMPILER_SINCE(GCC, 4, 9, 0) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L) +#elif RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L) -#elif RUBY3_HAS_FEATURE(cxx_relaxed_constexpr) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 1 -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 1 +#elif RBIMPL_HAS_FEATURE(cxx_relaxed_constexpr) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 1 +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 1 -#elif RUBY3_HAS_FEATURE(cxx_constexpr) -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 1 -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 0 +#elif RBIMPL_HAS_FEATURE(cxx_constexpr) +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 1 +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0 #else # /* :FIXME: icpc must have constexpr but don't know how to detect. */ -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 0 -# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 0 +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 0 +# define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0 #endif /** @endcond */ /** Wraps (or simulates) C++11 `constexpr`. */ -#if RUBY3_HAS_ATTR_CONSTEXPR_CXX14 -# define RUBY3_ATTR_CONSTEXPR(_) constexpr +#if RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 +# define RBIMPL_ATTR_CONSTEXPR(_) constexpr -#elif RUBY3_HAS_ATTR_CONSTEXPR_CXX11 -# define RUBY3_ATTR_CONSTEXPR(_) RUBY3_TOKEN_PASTE(RUBY3_ATTR_CONSTEXPR_, _) -# define RUBY3_ATTR_CONSTEXPR_CXX11 constexpr -# define RUBY3_ATTR_CONSTEXPR_CXX14 /* void */ +#elif RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 +# define RBIMPL_ATTR_CONSTEXPR(_) RBIMPL_TOKEN_PASTE(RBIMPL_ATTR_CONSTEXPR_, _) +# define RBIMPL_ATTR_CONSTEXPR_CXX11 constexpr +# define RBIMPL_ATTR_CONSTEXPR_CXX14 /* void */ #else -# define RUBY3_ATTR_CONSTEXPR(_) /* void */ +# define RBIMPL_ATTR_CONSTEXPR(_) /* void */ #endif -/** Enables #RUBY3_ATTR_CONSTEXPR iff. #RUBY_NDEBUG. */ +/** Enables #RBIMPL_ATTR_CONSTEXPR iff. #RUBY_NDEBUG. */ #if RUBY_NDEBUG -# define RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(_) RUBY3_ATTR_CONSTEXPR(_) +# define RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(_) RBIMPL_ATTR_CONSTEXPR(_) #else -# define RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(_) /* void */ +# define RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(_) /* void */ #endif -#endif /* RUBY3_ATTR_CONSTEXPR_H */ +#endif /* RBIMPL_ATTR_CONSTEXPR_H */ diff --git a/include/ruby/impl/attr/deprecated.h b/include/ruby/impl/attr/deprecated.h index a9195b17e8..5c8b58af84 100644 --- a/include/ruby/impl/attr/deprecated.h +++ b/include/ruby/impl/attr/deprecated.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_DEPRECATED_H +#ifndef RBIMPL_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_DEPRECATED_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_DEPRECATED. + * @brief Defines #RBIMPL_ATTR_DEPRECATED. */ #include "ruby/impl/compiler_since.h" #include "ruby/impl/has/attribute.h" @@ -28,32 +28,32 @@ #include "ruby/impl/has/extension.h" /** Wraps (or simulates) `[[deprecated]]` */ -#if RUBY3_HAS_EXTENSION(attribute_deprecated_with_message) -# define RUBY3_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg)) +#if RBIMPL_HAS_EXTENSION(attribute_deprecated_with_message) +# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg)) -#elif RUBY3_COMPILER_SINCE(GCC, 4, 5, 0) -# define RUBY3_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg)) +#elif RBIMPL_COMPILER_SINCE(GCC, 4, 5, 0) +# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg)) -#elif RUBY3_COMPILER_SINCE(Intel, 13, 0, 0) -# define RUBY3_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg)) +#elif RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0) +# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg)) -#elif RUBY3_HAS_ATTRIBUTE(deprecated) /* but not with message. */ -# define RUBY3_ATTR_DEPRECATED(msg) __attribute__((__deprecated__)) +#elif RBIMPL_HAS_ATTRIBUTE(deprecated) /* but not with message. */ +# define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__)) -#elif RUBY3_COMPILER_SINCE(MSVC, 14, 0, 0) -# define RUBY3_ATTR_DEPRECATED(msg) __declspec(deprecated msg) +#elif RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0) +# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated msg) -#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(deprecated) -# define RUBY3_ATTR_DEPRECATED(msg) __declspec(deprecated) +#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(deprecated) +# define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated) -#elif RUBY3_HAS_CPP_ATTRIBUTE(deprecated) -# define RUBY3_ATTR_DEPRECATED(msg) [[deprecated msg]] +#elif RBIMPL_HAS_CPP_ATTRIBUTE(deprecated) +# define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]] -#elif RUBY3_HAS_C_ATTRIBUTE(deprecated) -# define RUBY3_ATTR_DEPRECATED(msg) [[deprecated msg]] +#elif RBIMPL_HAS_C_ATTRIBUTE(deprecated) +# define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]] #else -# define RUBY3_ATTR_DEPRECATED(msg) /* void */ +# define RBIMPL_ATTR_DEPRECATED(msg) /* void */ #endif -#endif /* RUBY3_ATTR_DEPRECATED_H */ +#endif /* RBIMPL_ATTR_DEPRECATED_H */ diff --git a/include/ruby/impl/attr/diagnose_if.h b/include/ruby/impl/attr/diagnose_if.h index 13399600d1..6b30a641c6 100644 --- a/include/ruby/impl/attr/diagnose_if.h +++ b/include/ruby/impl/attr/diagnose_if.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_DIAGNOSE_IF_H +#ifndef RBIMPL_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_DIAGNOSE_IF_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,25 +18,25 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_DIAGNOSE_IF. + * @brief Defines #RBIMPL_ATTR_DIAGNOSE_IF. */ #include "ruby/impl/has/attribute.h" #include "ruby/impl/warning_push.h" /** Wraps (or simulates) `__attribute__((diagnose_if))` */ -#if RUBY3_COMPILER_BEFORE(Clang, 5, 0, 0) +#if RBIMPL_COMPILER_BEFORE(Clang, 5, 0, 0) # /* https://bugs.llvm.org/show_bug.cgi?id=34319 */ -# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) /* void */ +# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */ -#elif RUBY3_HAS_ATTRIBUTE(diagnose_if) -# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) \ - RUBY3_WARNING_PUSH() \ - RUBY3_WARNING_IGNORED(-Wgcc-compat) \ +#elif RBIMPL_HAS_ATTRIBUTE(diagnose_if) +# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) \ + RBIMPL_WARNING_PUSH() \ + RBIMPL_WARNING_IGNORED(-Wgcc-compat) \ __attribute__((__diagnose_if__(_, __, ___))) \ - RUBY3_WARNING_POP() + RBIMPL_WARNING_POP() #else -# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) /* void */ +# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */ #endif -#endif /* RUBY3_ATTR_DIAGNOSE_IF_H */ +#endif /* RBIMPL_ATTR_DIAGNOSE_IF_H */ diff --git a/include/ruby/impl/attr/enum_extensibility.h b/include/ruby/impl/attr/enum_extensibility.h index c7a64933d8..65e461bfb0 100644 --- a/include/ruby/impl/attr/enum_extensibility.h +++ b/include/ruby/impl/attr/enum_extensibility.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_ENUM_EXTENSIBILITY_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_ENUM_EXTENSIBILITY_H +#ifndef RBIMPL_ATTR_ENUM_EXTENSIBILITY_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_ENUM_EXTENSIBILITY_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,15 +18,15 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief #RUBY3_ATTR_ENUM_EXTENSIBILITY. + * @brief #RBIMPL_ATTR_ENUM_EXTENSIBILITY. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((enum_extensibility))` */ -#if RUBY3_HAS_ATTRIBUTE(enum_extensibility) -# define RUBY3_ATTR_ENUM_EXTENSIBILITY(_) __attribute__((__enum_extensibility__(_))) +#if RBIMPL_HAS_ATTRIBUTE(enum_extensibility) +# define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_) __attribute__((__enum_extensibility__(_))) #else -# define RUBY3_ATTR_ENUM_EXTENSIBILITY(_) /* void */ +# define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_) /* void */ #endif -#endif /* RUBY3_ATTR_ENUM_EXTENSIBILITY_H */ +#endif /* RBIMPL_ATTR_ENUM_EXTENSIBILITY_H */ diff --git a/include/ruby/impl/attr/error.h b/include/ruby/impl/attr/error.h index c0d5ed51af..df62738b3c 100644 --- a/include/ruby/impl/attr/error.h +++ b/include/ruby/impl/attr/error.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_ERROR_H +#ifndef RBIMPL_ATTR_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_ERROR_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,15 +18,15 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_ERROR. + * @brief Defines #RBIMPL_ATTR_ERROR. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((error))` */ -#if RUBY3_HAS_ATTRIBUTE(error) -# define RUBY3_ATTR_ERROR(msg) __attribute__((__error__ msg)) +#if RBIMPL_HAS_ATTRIBUTE(error) +# define RBIMPL_ATTR_ERROR(msg) __attribute__((__error__ msg)) #else -# define RUBY3_ATTR_ERROR(msg) /* void */ +# define RBIMPL_ATTR_ERROR(msg) /* void */ #endif -#endif /* RUBY3_ATTR_ERROR_H */ +#endif /* RBIMPL_ATTR_ERROR_H */ diff --git a/include/ruby/impl/attr/flag_enum.h b/include/ruby/impl/attr/flag_enum.h index 0649869b4a..a31a4f012d 100644 --- a/include/ruby/impl/attr/flag_enum.h +++ b/include/ruby/impl/attr/flag_enum.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_FLAG_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_FLAG_ENUM_H +#ifndef RBIMPL_ATTR_FLAG_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_FLAG_ENUM_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,16 +18,16 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_FLAG_ENUM. + * @brief Defines #RBIMPL_ATTR_FLAG_ENUM. * @see https://clang.llvm.org/docs/AttributeReference.html#flag_enum */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((flag_enum)` */ -#if RUBY3_HAS_ATTRIBUTE(flag_enum) -# define RUBY3_ATTR_FLAG_ENUM() __attribute__((__flag_enum__)) +#if RBIMPL_HAS_ATTRIBUTE(flag_enum) +# define RBIMPL_ATTR_FLAG_ENUM() __attribute__((__flag_enum__)) #else -# define RUBY3_ATTR_FLAG_ENUM() /* void */ +# define RBIMPL_ATTR_FLAG_ENUM() /* void */ #endif -#endif /* RUBY3ATTR_FLAG_ENUM_H */ +#endif /* RBIMPLATTR_FLAG_ENUM_H */ diff --git a/include/ruby/impl/attr/forceinline.h b/include/ruby/impl/attr/forceinline.h index 95fe2b843a..1b9e54eca9 100644 --- a/include/ruby/impl/attr/forceinline.h +++ b/include/ruby/impl/attr/forceinline.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_FORCEINLINE_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_FORCEINLINE_H +#ifndef RBIMPL_ATTR_FORCEINLINE_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_FORCEINLINE_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_FORCEINLINE. + * @brief Defines #RBIMPL_ATTR_FORCEINLINE. */ #include "ruby/impl/compiler_since.h" #include "ruby/impl/has/attribute.h" @@ -29,12 +29,12 @@ * `__forceinline` are mutually exclusive. We have to mimic that behaviour for * non-MSVC compilers. */ -#if RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0) -# define RUBY3_ATTR_FORCEINLINE() __forceinline -#elif RUBY3_HAS_ATTRIBUTE(always_inline) -# define RUBY3_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline +#if RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0) +# define RBIMPL_ATTR_FORCEINLINE() __forceinline +#elif RBIMPL_HAS_ATTRIBUTE(always_inline) +# define RBIMPL_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline #else -# define RUBY3_ATTR_FORCEINLINE() inline +# define RBIMPL_ATTR_FORCEINLINE() inline #endif -#endif /* RUBY3_ATTR_FORCEINLINE_H */ +#endif /* RBIMPL_ATTR_FORCEINLINE_H */ diff --git a/include/ruby/impl/attr/format.h b/include/ruby/impl/attr/format.h index 0ae980afcd..e111371395 100644 --- a/include/ruby/impl/attr/format.h +++ b/include/ruby/impl/attr/format.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_FORMAT_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_FORMAT_H +#ifndef RBIMPL_ATTR_FORMAT_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_FORMAT_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,21 +18,21 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_FORMAT. + * @brief Defines #RBIMPL_ATTR_FORMAT. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((format))` */ -#if RUBY3_HAS_ATTRIBUTE(format) -# define RUBY3_ATTR_FORMAT(x, y, z) __attribute__((__format__(x, y, z))) +#if RBIMPL_HAS_ATTRIBUTE(format) +# define RBIMPL_ATTR_FORMAT(x, y, z) __attribute__((__format__(x, y, z))) #else -# define RUBY3_ATTR_FORMAT(x, y, z) /* void */ +# define RBIMPL_ATTR_FORMAT(x, y, z) /* void */ #endif #if defined(__MINGW_PRINTF_FORMAT) -# define RUBY3_PRINTF_FORMAT __MINGW_PRINTF_FORMAT +# define RBIMPL_PRINTF_FORMAT __MINGW_PRINTF_FORMAT #else -# define RUBY3_PRINTF_FORMAT __printf__ +# define RBIMPL_PRINTF_FORMAT __printf__ #endif -#endif /* RUBY3_ATTR_FORMAT_H */ +#endif /* RBIMPL_ATTR_FORMAT_H */ diff --git a/include/ruby/impl/attr/maybe_unused.h b/include/ruby/impl/attr/maybe_unused.h index decb338c39..c0b73d6f68 100644 --- a/include/ruby/impl/attr/maybe_unused.h +++ b/include/ruby/impl/attr/maybe_unused.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_MAYBE_UNUSED_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_MAYBE_UNUSED_H +#ifndef RBIMPL_ATTR_MAYBE_UNUSED_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_MAYBE_UNUSED_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,21 +18,21 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_MAYBE_UNUSED. + * @brief Defines #RBIMPL_ATTR_MAYBE_UNUSED. */ #include "ruby/impl/has/attribute.h" #include "ruby/impl/has/c_attribute.h" #include "ruby/impl/has/cpp_attribute.h" /** Wraps (or simulates) `[[maybe_unused]]` */ -#if RUBY3_HAS_CPP_ATTRIBUTE(maybe_unused) -# define RUBY3_ATTR_MAYBE_UNUSED() [[maybe_unused]] -#elif RUBY3_HAS_C_ATTRIBUTE(maybe_unused) -# define RUBY3_ATTR_MAYBE_UNUSED() [[maybe_unused]] -#elif RUBY3_HAS_ATTRIBUTE(unused) -# define RUBY3_ATTR_MAYBE_UNUSED() __attribute__((__unused__)) +#if RBIMPL_HAS_CPP_ATTRIBUTE(maybe_unused) +# define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]] +#elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused) +# define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]] +#elif RBIMPL_HAS_ATTRIBUTE(unused) +# define RBIMPL_ATTR_MAYBE_UNUSED() __attribute__((__unused__)) #else -# define RUBY3_ATTR_MAYBE_UNUSED() /* void */ +# define RBIMPL_ATTR_MAYBE_UNUSED() /* void */ #endif -#endif /* RUBY3_ATTR_MAYBE_UNUSED */ +#endif /* RBIMPL_ATTR_MAYBE_UNUSED */ diff --git a/include/ruby/impl/attr/noalias.h b/include/ruby/impl/attr/noalias.h index fc1012f45e..9df5c926c8 100644 --- a/include/ruby/impl/attr/noalias.h +++ b/include/ruby/impl/attr/noalias.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_NOALIAS_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_NOALIAS_H +#ifndef RBIMPL_ATTR_NOALIAS_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_NOALIAS_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,27 +18,27 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_NOALIAS. + * @brief Defines #RBIMPL_ATTR_NOALIAS. * * ### Q&A ### * - * - Q: There are seemingly similar attributes named #RUBY3_ATTR_CONST, - * #RUBY3_ATTR_PURE, and #RUBY3_ATTR_NOALIAS. What are the difference? + * - Q: There are seemingly similar attributes named #RBIMPL_ATTR_CONST, + * #RBIMPL_ATTR_PURE, and #RBIMPL_ATTR_NOALIAS. What are the difference? * * - A: Allowed operations are different. * - * - #RUBY3_ATTR_CONST ... Functions attributed by this are not allowed to + * - #RBIMPL_ATTR_CONST ... Functions attributed by this are not allowed to * read/write _any_ pointers at all (there are exceptional situations * when reading a pointer is possible but forget that; they are too * exceptional to be useful). Just remember that everything pointer- * related are NG. * - * - #RUBY3_ATTR_PURE ... Functions attributed by this can read any + * - #RBIMPL_ATTR_PURE ... Functions attributed by this can read any * nonvolatile pointers, but no writes are allowed at all. The ability * to read _any_ nonvolatile pointers makes it possible to mark ::VALUE- * taking functions as being pure, as long as they are read-only. * - * - #RUBY3_ATTR_NOALIAS ... Can both read/write, but only through pointers + * - #RBIMPL_ATTR_NOALIAS ... Can both read/write, but only through pointers * passed to the function as parameters. This is a typical situation * when you create a C++ non-static member function which only concerns * `this`. No global variables are allowed to read/write. So this is @@ -49,10 +49,10 @@ #include "ruby/impl/has/declspec_attribute.h" /** Wraps (or simulates) `__declspec((noalias))` */ -#if RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias) -# define RUBY3_ATTR_NOALIAS() __declspec(noalias) +#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias) +# define RBIMPL_ATTR_NOALIAS() __declspec(noalias) #else -# define RUBY3_ATTR_NOALIAS() /* void */ +# define RBIMPL_ATTR_NOALIAS() /* void */ #endif -#endif /* RUBY3_ATTR_NOALIAS_H */ +#endif /* RBIMPL_ATTR_NOALIAS_H */ diff --git a/include/ruby/impl/attr/nodiscard.h b/include/ruby/impl/attr/nodiscard.h index 394221969b..3bc9b805c8 100644 --- a/include/ruby/impl/attr/nodiscard.h +++ b/include/ruby/impl/attr/nodiscard.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_NODISCARD_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_NODISCARD_H +#ifndef RBIMPL_ATTR_NODISCARD_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_NODISCARD_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_NODISCARD. + * @brief Defines #RBIMPL_ATTR_NODISCARD. */ #include "ruby/impl/has/attribute.h" #include "ruby/impl/has/c_attribute.h" @@ -29,17 +29,17 @@ * nodiscard attribute can have a message why the result shall not be ignoed. * However GCC attribute and SAL annotation cannot take them. */ -#if RUBY3_HAS_CPP_ATTRIBUTE(nodiscard) -# define RUBY3_ATTR_NODISCARD() [[nodiscard]] -#elif RUBY3_HAS_C_ATTRIBUTE(nodiscard) -# define RUBY3_ATTR_NODISCARD() [[nodiscard]] -#elif RUBY3_HAS_ATTRIBUTE(warn_unused_result) -# define RUBY3_ATTR_NODISCARD() __attribute__((__warn_unused_result__)) +#if RBIMPL_HAS_CPP_ATTRIBUTE(nodiscard) +# define RBIMPL_ATTR_NODISCARD() [[nodiscard]] +#elif RBIMPL_HAS_C_ATTRIBUTE(nodiscard) +# define RBIMPL_ATTR_NODISCARD() [[nodiscard]] +#elif RBIMPL_HAS_ATTRIBUTE(warn_unused_result) +# define RBIMPL_ATTR_NODISCARD() __attribute__((__warn_unused_result__)) #elif defined(_Check_return_) # /* Take SAL definition. */ -# define RUBY3_ATTR_NODISCARD() _Check_return_ +# define RBIMPL_ATTR_NODISCARD() _Check_return_ #else -# define RUBY3_ATTR_NODISCARD() /* void */ +# define RBIMPL_ATTR_NODISCARD() /* void */ #endif -#endif /* RUBY3_ATTR_NODISCARD_H */ +#endif /* RBIMPL_ATTR_NODISCARD_H */ diff --git a/include/ruby/impl/attr/noexcept.h b/include/ruby/impl/attr/noexcept.h index ee7329b735..3d25886f35 100644 --- a/include/ruby/impl/attr/noexcept.h +++ b/include/ruby/impl/attr/noexcept.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_NOEXCEPT_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_NOEXCEPT_H +#ifndef RBIMPL_ATTR_NOEXCEPT_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_NOEXCEPT_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_NOEXCEPT. + * @brief Defines #RBIMPL_ATTR_NOEXCEPT. * * This isn't actually an attribute in C++ but who cares... * @@ -67,25 +67,25 @@ /** Wraps (or simulates) C++11 `noexcept` */ #if ! defined(__cplusplus) # /* Doesn't make sense. */ -# define RUBY3_ATTR_NOEXCEPT(_) /* void */ +# define RBIMPL_ATTR_NOEXCEPT(_) /* void */ -#elif RUBY3_HAS_FEATURE(cxx_noexcept) -# define RUBY3_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) +#elif RBIMPL_HAS_FEATURE(cxx_noexcept) +# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) #elif defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__ -# define RUBY3_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) +# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) #elif defined(__INTEL_CXX11_MODE__) -# define RUBY3_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) +# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) -#elif RUBY3_COMPILER_SINCE(MSVC, 19, 0, 0) -# define RUBY3_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) +#elif RBIMPL_COMPILER_SINCE(MSVC, 19, 0, 0) +# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) #elif __cplusplus >= 201103L -# define RUBY3_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) +# define RBIMPL_ATTR_NOEXCEPT(_) noexcept(noexcept(_)) #else -# define RUBY3_ATTR_NOEXCEPT(_) /* void */ +# define RBIMPL_ATTR_NOEXCEPT(_) /* void */ #endif -#endif /* RUBY3_ATTR_NOEXCEPT_H */ +#endif /* RBIMPL_ATTR_NOEXCEPT_H */ diff --git a/include/ruby/impl/attr/noinline.h b/include/ruby/impl/attr/noinline.h index 58ffbe207c..c59be3a980 100644 --- a/include/ruby/impl/attr/noinline.h +++ b/include/ruby/impl/attr/noinline.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_NOINLINE_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_NOINLINE_H +#ifndef RBIMPL_ATTR_NOINLINE_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_NOINLINE_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,18 +18,18 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_NOINLINE. + * @brief Defines #RBIMPL_ATTR_NOINLINE. */ #include "ruby/impl/has/attribute.h" #include "ruby/impl/has/declspec_attribute.h" /** Wraps (or simulates) `__declspec(noinline)` */ -#if RUBY3_HAS_DECLSPEC_ATTRIBUTE(noinline) -# define RUBY3_ATTR_NOINLINE() __declspec(noinline) -#elif RUBY3_HAS_ATTRIBUTE(noinline) -# define RUBY3_ATTR_NOINLINE() __attribute__((__noinline__)) +#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noinline) +# define RBIMPL_ATTR_NOINLINE() __declspec(noinline) +#elif RBIMPL_HAS_ATTRIBUTE(noinline) +# define RBIMPL_ATTR_NOINLINE() __attribute__((__noinline__)) #else -# define RUBY3_ATTR_NOINLINE() /* void */ +# define RBIMPL_ATTR_NOINLINE() /* void */ #endif -#endif /* RUBY3_ATTR_NOINLINE_H */ +#endif /* RBIMPL_ATTR_NOINLINE_H */ diff --git a/include/ruby/impl/attr/nonnull.h b/include/ruby/impl/attr/nonnull.h index ad883f04db..fb6916f1bc 100644 --- a/include/ruby/impl/attr/nonnull.h +++ b/include/ruby/impl/attr/nonnull.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_NONNULL_H +#ifndef RBIMPL_ATTR_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_NONNULL_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,15 +18,15 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_NONNULL. + * @brief Defines #RBIMPL_ATTR_NONNULL. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((nonnull))` */ -#if RUBY3_HAS_ATTRIBUTE(nonnull) -# define RUBY3_ATTR_NONNULL(list) __attribute__((__nonnull__ list)) +#if RBIMPL_HAS_ATTRIBUTE(nonnull) +# define RBIMPL_ATTR_NONNULL(list) __attribute__((__nonnull__ list)) #else -# define RUBY3_ATTR_NONNULL(list) /* void */ +# define RBIMPL_ATTR_NONNULL(list) /* void */ #endif -#endif /* RUBY3_ATTR_NONNULL_H */ +#endif /* RBIMPL_ATTR_NONNULL_H */ diff --git a/include/ruby/impl/attr/noreturn.h b/include/ruby/impl/attr/noreturn.h index 90cec9a01a..5033dd1656 100644 --- a/include/ruby/impl/attr/noreturn.h +++ b/include/ruby/impl/attr/noreturn.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_NORETURN_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_NORETURN_H +#ifndef RBIMPL_ATTR_NORETURN_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_NORETURN_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,7 +18,7 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_NORETURN. + * @brief Defines #RBIMPL_ATTR_NORETURN. */ #include "ruby/impl/compiler_since.h" #include "ruby/impl/has/attribute.h" @@ -26,27 +26,27 @@ #include "ruby/impl/has/declspec_attribute.h" /** Wraps (or simulates) `[[noreturn]]` */ -#if RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_ATTR_NORETURN() _Pragma("does_not_return") +#if RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0) +# define RBIMPL_ATTR_NORETURN() _Pragma("does_not_return") -#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noreturn) -# define RUBY3_ATTR_NORETURN() __declspec(noreturn) +#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noreturn) +# define RBIMPL_ATTR_NORETURN() __declspec(noreturn) -#elif RUBY3_HAS_ATTRIBUTE(noreturn) -# define RUBY3_ATTR_NORETURN() __attribute__((__noreturn__)) +#elif RBIMPL_HAS_ATTRIBUTE(noreturn) +# define RBIMPL_ATTR_NORETURN() __attribute__((__noreturn__)) -#elif RUBY3_HAS_CPP_ATTRIBUTE(noreturn) -# define RUBY3_ATTR_NORETURN() [[noreturn]] +#elif RBIMPL_HAS_CPP_ATTRIBUTE(noreturn) +# define RBIMPL_ATTR_NORETURN() [[noreturn]] #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112) -# define RUBY3_ATTR_NORETURN() _Noreturn +# define RBIMPL_ATTR_NORETURN() _Noreturn #elif defined(_Noreturn) # /* glibc <sys/cdefs.h> has this macro. */ -# define RUBY3_ATTR_NORETURN() _Noreturn +# define RBIMPL_ATTR_NORETURN() _Noreturn #else -# define RUBY3_ATTR_NORETURN() /* void */ +# define RBIMPL_ATTR_NORETURN() /* void */ #endif -#endif /* RUBY3_ATTR_NORETURN_H */ +#endif /* RBIMPL_ATTR_NORETURN_H */ diff --git a/include/ruby/impl/attr/pure.h b/include/ruby/impl/attr/pure.h index e2cd27279e..6d43f3fdcd 100644 --- a/include/ruby/impl/attr/pure.h +++ b/include/ruby/impl/attr/pure.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_PURE_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_PURE_H +#ifndef RBIMPL_ATTR_PURE_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_PURE_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,26 +18,26 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_PURE. + * @brief Defines #RBIMPL_ATTR_PURE. */ #include "ruby/impl/compiler_since.h" #include "ruby/impl/has/attribute.h" #include "ruby/assert.h" /** Wraps (or simulates) `__attribute__((pure))` */ -#if RUBY3_HAS_ATTRIBUTE(pure) -# define RUBY3_ATTR_PURE() __attribute__((__pure__)) -#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_ATTR_PURE() _Pragma("does_not_write_global_data") +#if RBIMPL_HAS_ATTRIBUTE(pure) +# define RBIMPL_ATTR_PURE() __attribute__((__pure__)) +#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0) +# define RBIMPL_ATTR_PURE() _Pragma("does_not_write_global_data") #else -# define RUBY3_ATTR_PURE() /* void */ +# define RBIMPL_ATTR_PURE() /* void */ #endif -/** Enables #RUBY3_ATTR_PURE iff. #RUBY_NDEBUG. */ +/** Enables #RBIMPL_ATTR_PURE iff. #RUBY_NDEBUG. */ #if RUBY_NDEBUG -# define RUBY3_ATTR_PURE_ON_NDEBUG() RUBY3_ATTR_PURE() +# define RBIMPL_ATTR_PURE_ON_NDEBUG() RBIMPL_ATTR_PURE() #else -# define RUBY3_ATTR_PURE_ON_NDEBUG() /* void */ +# define RBIMPL_ATTR_PURE_ON_NDEBUG() /* void */ #endif -#endif /* RUBY3_ATTR_PURE_H */ +#endif /* RBIMPL_ATTR_PURE_H */ diff --git a/include/ruby/impl/attr/restrict.h b/include/ruby/impl/attr/restrict.h index 09240a2563..fab2d3c7a4 100644 --- a/include/ruby/impl/attr/restrict.h +++ b/include/ruby/impl/attr/restrict.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_RESTRICT_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_RESTRICT_H +#ifndef RBIMPL_ATTR_RESTRICT_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_RESTRICT_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,28 +18,28 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_RESTRICT. + * @brief Defines #RBIMPL_ATTR_RESTRICT. */ #include "ruby/impl/compiler_since.h" #include "ruby/impl/has/attribute.h" #include "ruby/impl/token_paste.h" /* :FIXME: config.h includes conflicting `#define restrict`. MSVC can be - * detected using `RUBY3_COMPILER_SINCE()`, but Clang & family cannot use + * detected using `RBIMPL_COMPILER_SINCE()`, but Clang & family cannot use * `__has_declspec_attribute()` which involves macro substitution. */ /** Wraps (or simulates) `__declspec(restrict)` */ -#if RUBY3_COMPILER_SINCE(MSVC, 14, 0, 0) -# define RUBY3_ATTR_RESTRICT() __declspec(RUBY3_TOKEN_PASTE(re, strict)) +#if RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0) +# define RBIMPL_ATTR_RESTRICT() __declspec(RBIMPL_TOKEN_PASTE(re, strict)) -#elif RUBY3_HAS_ATTRIBUTE(malloc) -# define RUBY3_ATTR_RESTRICT() __attribute__((__malloc__)) +#elif RBIMPL_HAS_ATTRIBUTE(malloc) +# define RBIMPL_ATTR_RESTRICT() __attribute__((__malloc__)) -#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_ATTR_RESTRICT() _Pragma("returns_new_memory") +#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0) +# define RBIMPL_ATTR_RESTRICT() _Pragma("returns_new_memory") #else -# define RUBY3_ATTR_RESTRICT() /* void */ +# define RBIMPL_ATTR_RESTRICT() /* void */ #endif -#endif /* RUBY3_ATTR_RESTRICT_H */ +#endif /* RBIMPL_ATTR_RESTRICT_H */ diff --git a/include/ruby/impl/attr/returns_nonnull.h b/include/ruby/impl/attr/returns_nonnull.h index 3eb9180cab..28f94effc3 100644 --- a/include/ruby/impl/attr/returns_nonnull.h +++ b/include/ruby/impl/attr/returns_nonnull.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_RETURNS_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_RETURNS_NONNULL_H +#ifndef RBIMPL_ATTR_RETURNS_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_RETURNS_NONNULL_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,20 +18,20 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_RETURNS_NONNULL. + * @brief Defines #RBIMPL_ATTR_RETURNS_NONNULL. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((returns_nonnull))` */ #if defined(_Ret_nonnull_) # /* Take SAL definition. */ -# define RUBY3_ATTR_RETURNS_NONNULL() _Ret_nonnull_ +# define RBIMPL_ATTR_RETURNS_NONNULL() _Ret_nonnull_ -#elif RUBY3_HAS_ATTRIBUTE(returns_nonnull) -# define RUBY3_ATTR_RETURNS_NONNULL() __attribute__((__returns_nonnull__)) +#elif RBIMPL_HAS_ATTRIBUTE(returns_nonnull) +# define RBIMPL_ATTR_RETURNS_NONNULL() __attribute__((__returns_nonnull__)) #else -# define RUBY3_ATTR_RETURNS_NONNULL() /* void */ +# define RBIMPL_ATTR_RETURNS_NONNULL() /* void */ #endif -#endif /* RUBY3_ATTR_RETURNS_NONNULL_H */ +#endif /* RBIMPL_ATTR_RETURNS_NONNULL_H */ diff --git a/include/ruby/impl/attr/warning.h b/include/ruby/impl/attr/warning.h index 5f665c9d17..497b48c41e 100644 --- a/include/ruby/impl/attr/warning.h +++ b/include/ruby/impl/attr/warning.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_WARNING_H +#ifndef RBIMPL_ATTR_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_WARNING_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,15 +18,15 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_WARNING. + * @brief Defines #RBIMPL_ATTR_WARNING. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((warning))` */ -#if RUBY3_HAS_ATTRIBUTE(warning) -# define RUBY3_ATTR_WARNING(msg) __attribute__((__warning__ msg)) +#if RBIMPL_HAS_ATTRIBUTE(warning) +# define RBIMPL_ATTR_WARNING(msg) __attribute__((__warning__ msg)) #else -# define RUBY3_ATTR_WARNING(msg) /* void */ +# define RBIMPL_ATTR_WARNING(msg) /* void */ #endif -#endif /* RUBY3_ATTR_WARNING_H */ +#endif /* RBIMPL_ATTR_WARNING_H */ diff --git a/include/ruby/impl/attr/weakref.h b/include/ruby/impl/attr/weakref.h index 04d8f77c13..8593196685 100644 --- a/include/ruby/impl/attr/weakref.h +++ b/include/ruby/impl/attr/weakref.h @@ -1,5 +1,5 @@ -#ifndef RUBY3_ATTR_WEAKREF_H /*-*-C++-*-vi:se ft=cpp:*/ -#define RUBY3_ATTR_WEAKREF_H +#ifndef RBIMPL_ATTR_WEAKREF_H /*-*-C++-*-vi:se ft=cpp:*/ +#define RBIMPL_ATTR_WEAKREF_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> @@ -7,7 +7,7 @@ * Permission is hereby granted, to either redistribute and/or * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are + * @warning Symbols prefixed with either `RBIMPL` or `ruby3` are * implementation details. Don't take them as canon. They could * rapidly appear then vanish. The name (path) of this header file * is also an implementation detail. Do not expect it to persist @@ -18,15 +18,15 @@ * Do not expect for instance `__VA_ARGS__` is always available. * We assume C99 for ruby itself but we don't assume languages of * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_ATTR_WEAKREF. + * @brief Defines #RBIMPL_ATTR_WEAKREF. */ #include "ruby/impl/has/attribute.h" /** Wraps (or simulates) `__attribute__((weakref))` */ -#if RUBY3_HAS_ATTRIBUTE(weakref) -# define RUBY3_ATTR_WEAKREF(sym) __attribute__((__weakref__(# sym))) +#if RBIMPL_HAS_ATTRIBUTE(weakref) +# define RBIMPL_ATTR_WEAKREF(sym) __attribute__((__weakref__(# sym))) #else -# define RUBY3_ATTR_WEAKREF(sym) /* void */ +# define RBIMPL_ATTR_WEAKREF(sym) /* void */ #endif -#endif /* RUBY3_ATTR_WEAKREF_H */ +#endif /* RBIMPL_ATTR_WEAKREF_H */ |
