Devs do not love "3".  The only exception is RUBY3_KEYWORDS in parse.y,
which seems unrelated to our interests.
This commit is contained in:
卜部昌平 2020-05-04 15:52:56 +09:00
Родитель d7f4d732c1
Коммит 97672f669a
175 изменённых файлов: 2230 добавлений и 2230 удалений

2
gc.c
Просмотреть файл

@ -9603,7 +9603,7 @@ ruby_memerror_body(void *dummy)
}
NORETURN(static void ruby_memerror(void));
RUBY3_ATTR_MAYBE_UNUSED()
RBIMPL_ATTR_MAYBE_UNUSED()
static void
ruby_memerror(void)
{

Просмотреть файл

@ -8,7 +8,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
@ -48,25 +48,25 @@
# define RUBY_NDEBUG 1
#endif
#define RUBY3_ASSERT_NOTHING RUBY3_CAST((void)0)
#define RBIMPL_ASSERT_NOTHING RBIMPL_CAST((void)0)
RUBY3_SYMBOL_EXPORT_BEGIN()
RUBY3_ATTR_NORETURN()
RUBY3_ATTR_COLD()
RBIMPL_SYMBOL_EXPORT_BEGIN()
RBIMPL_ATTR_NORETURN()
RBIMPL_ATTR_COLD()
void rb_assert_failure(const char *file, int line, const char *name, const char *expr);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#ifdef RUBY_FUNCTION_NAME_STRING
# define RUBY3_ASSERT_FUNC RUBY_FUNCTION_NAME_STRING
# define RBIMPL_ASSERT_FUNC RUBY_FUNCTION_NAME_STRING
#else
# define RUBY3_ASSERT_FUNC RUBY3_CAST((const char *)0)
# define RBIMPL_ASSERT_FUNC RBIMPL_CAST((const char *)0)
#endif
#define RUBY_ASSERT_FAIL(expr) \
rb_assert_failure(__FILE__, __LINE__, RUBY3_ASSERT_FUNC, #expr)
rb_assert_failure(__FILE__, __LINE__, RBIMPL_ASSERT_FUNC, #expr)
#define RUBY_ASSERT_MESG(expr, mesg) \
(RB_LIKELY(expr) ? RUBY3_ASSERT_NOTHING : RUBY_ASSERT_FAIL(mesg))
(RB_LIKELY(expr) ? RBIMPL_ASSERT_NOTHING : RUBY_ASSERT_FAIL(mesg))
#if RUBY_DEBUG
# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) RUBY_ASSERT_MESG((expr), mesg)
@ -78,7 +78,7 @@ RUBY3_SYMBOL_EXPORT_END()
__builtin_constant_p(cond), \
__builtin_choose_expr(cond, \
RUBY_ASSERT_MESG(expr, mesg), \
RUBY3_ASSERT_NOTHING), \
RBIMPL_ASSERT_NOTHING), \
RUBY_ASSERT_MESG(!(cond) || (expr), mesg))
#endif /* RUBY_DEBUG */
@ -87,13 +87,13 @@ RUBY3_SYMBOL_EXPORT_END()
#define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG_WHEN(TRUE, expr, #expr)
#if ! RUBY_NDEBUG
# define RUBY3_ASSERT_OR_ASSUME(_) RUBY_ASSERT(_)
#elif defined(RUBY3_HAVE___ASSUME)
# define RUBY3_ASSERT_OR_ASSUME(_) RUBY3_ASSUME(_)
#elif RUBY3_HAS_BUILTIN(__builtin_assume)
# define RUBY3_ASSERT_OR_ASSUME(_) RUBY3_ASSUME(_)
# define RBIMPL_ASSERT_OR_ASSUME(_) RUBY_ASSERT(_)
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_ASSERT_OR_ASSUME(_) RBIMPL_ASSUME(_)
#elif RBIMPL_HAS_BUILTIN(__builtin_assume)
# define RBIMPL_ASSERT_OR_ASSUME(_) RBIMPL_ASSUME(_)
#else
# define RUBY3_ASSERT_OR_ASSUME(_) /* void */
# define RBIMPL_ASSERT_OR_ASSUME(_) /* void */
#endif
#endif /* RUBY_ASSERT_H */

Просмотреть файл

@ -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
@ -26,12 +26,12 @@
#undef ASSUME /* Kill config.h definition */
#undef UNREACHABLE /* Kill config.h definition */
#define ASSUME RUBY3_ASSUME
#define UNREACHABLE RUBY3_UNREACHABLE()
#define UNREACHABLE_RETURN RUBY3_UNREACHABLE_RETURN
#define ASSUME RBIMPL_ASSUME
#define UNREACHABLE RBIMPL_UNREACHABLE()
#define UNREACHABLE_RETURN RBIMPL_UNREACHABLE_RETURN
/* likely */
#if RUBY3_HAS_BUILTIN(__builtin_expect)
#if RBIMPL_HAS_BUILTIN(__builtin_expect)
# define RB_LIKELY(x) (__builtin_expect(!!(x), 1))
# define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0))

Просмотреть файл

@ -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
@ -48,42 +48,42 @@
/* function attributes */
#undef CONSTFUNC
#define CONSTFUNC(x) RUBY3_ATTR_CONST() x
#define CONSTFUNC(x) RBIMPL_ATTR_CONST() x
#undef PUREFUNC
#define PUREFUNC(x) RUBY3_ATTR_PURE() x
#define PUREFUNC(x) RBIMPL_ATTR_PURE() x
#undef DEPRECATED
#define DEPRECATED(x) RUBY3_ATTR_DEPRECATED(("")) x
#define DEPRECATED(x) RBIMPL_ATTR_DEPRECATED(("")) x
#undef DEPRECATED_BY
#define DEPRECATED_BY(n,x) RUBY3_ATTR_DEPRECATED(("by: " # n)) x
#define DEPRECATED_BY(n,x) RBIMPL_ATTR_DEPRECATED(("by: " # n)) x
#undef DEPRECATED_TYPE
#define DEPRECATED_TYPE(mseg, decl) decl RUBY3_ATTR_DEPRECATED(mseg)
#define DEPRECATED_TYPE(mseg, decl) decl RBIMPL_ATTR_DEPRECATED(mseg)
#undef RUBY_CXX_DEPRECATED
#define RUBY_CXX_DEPRECATED(mseg) RUBY3_ATTR_DEPRECATED((mseg))
#define RUBY_CXX_DEPRECATED(mseg) RBIMPL_ATTR_DEPRECATED((mseg))
#undef NOINLINE
#define NOINLINE(x) RUBY3_ATTR_NOINLINE() x
#define NOINLINE(x) RBIMPL_ATTR_NOINLINE() x
#ifndef MJIT_HEADER
# undef ALWAYS_INLINE
# define ALWAYS_INLINE(x) RUBY3_ATTR_FORCEINLINE() x
# define ALWAYS_INLINE(x) RBIMPL_ATTR_FORCEINLINE() x
#endif
#undef ERRORFUNC
#define ERRORFUNC(mesg, x) RUBY3_ATTR_ERROR(mesg) x
#if RUBY3_HAS_ATTRIBUTE(error)
#define ERRORFUNC(mesg, x) RBIMPL_ATTR_ERROR(mesg) x
#if RBIMPL_HAS_ATTRIBUTE(error)
# define HAVE_ATTRIBUTE_ERRORFUNC 1
#else
# define HAVE_ATTRIBUTE_ERRORFUNC 0
#endif
#undef WARNINGFUNC
#define WARNINGFUNC(mesg, x) RUBY3_ATTR_WARNING(mesg) x
#if RUBY3_HAS_ATTRIBUTE(warning)
#define WARNINGFUNC(mesg, x) RBIMPL_ATTR_WARNING(mesg) x
#if RBIMPL_HAS_ATTRIBUTE(warning)
# define HAVE_ATTRIBUTE_WARNINGFUNC 1
#else
# define HAVE_ATTRIBUTE_WARNINGFUNC 0
@ -94,20 +94,20 @@
RUBY_FUNC_ATTRIBUTE not used because MSVC does not like nested func macros
*/
#undef COLDFUNC
#define COLDFUNC RUBY3_ATTR_COLD()
#define COLDFUNC RBIMPL_ATTR_COLD()
#define PRINTF_ARGS(decl, string_index, first_to_check) \
RUBY3_ATTR_FORMAT(RUBY3_PRINTF_FORMAT, (string_index), (first_to_check)) \
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, (string_index), (first_to_check)) \
decl
#undef RUBY_ATTR_ALLOC_SIZE
#define RUBY_ATTR_ALLOC_SIZE RUBY3_ATTR_ALLOC_SIZE
#define RUBY_ATTR_ALLOC_SIZE RBIMPL_ATTR_ALLOC_SIZE
#undef RUBY_ATTR_MALLOC
#define RUBY_ATTR_MALLOC RUBY3_ATTR_RESTRICT()
#define RUBY_ATTR_MALLOC RBIMPL_ATTR_RESTRICT()
#undef RUBY_ATTR_RETURNS_NONNULL
#define RUBY_ATTR_RETURNS_NONNULL RUBY3_ATTR_RETURNS_NONNULL()
#define RUBY_ATTR_RETURNS_NONNULL RBIMPL_ATTR_RETURNS_NONNULL()
#ifndef FUNC_MINIMIZED
#define FUNC_MINIMIZED(x) x
@ -133,10 +133,10 @@
#endif
#undef RUBY_FUNC_NONNULL
#define RUBY_FUNC_NONNULL(n, x) RUBY3_ATTR_NONNULL(n) x
#define RUBY_FUNC_NONNULL(n, x) RBIMPL_ATTR_NONNULL(n) x
#undef NORETURN
#define NORETURN(x) RUBY3_ATTR_NORETURN() x
#define NORETURN(x) RBIMPL_ATTR_NORETURN() x
#define NORETURN_STYLE_NEW
#ifndef PACKED_STRUCT
@ -152,6 +152,6 @@
#endif
#undef RB_UNUSED_VAR
#define RB_UNUSED_VAR(x) x RUBY3_ATTR_MAYBE_UNUSED()
#define RB_UNUSED_VAR(x) x RBIMPL_ATTR_MAYBE_UNUSED()
#endif /* RUBY_BACKWARD2_ATTRIBUTES_H */

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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
@ -23,16 +23,16 @@
#include "ruby/impl/compiler_since.h"
#ifndef GCC_VERSION_SINCE
#define GCC_VERSION_SINCE(x, y, z) RUBY3_COMPILER_SINCE(GCC, (x), (y), (z))
#define GCC_VERSION_SINCE(x, y, z) RBIMPL_COMPILER_SINCE(GCC, (x), (y), (z))
#endif
#ifndef GCC_VERSION_BEFORE
#define GCC_VERSION_BEFORE(x, y, z) \
(RUBY3_COMPILER_BEFORE(GCC, (x), (y), (z)) || \
(RUBY3_COMPILER_IS(GCC) && \
((RUBY3_COMPILER_VERSION_MAJOR == (x)) && \
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH == (z))))))
(RBIMPL_COMPILER_BEFORE(GCC, (x), (y), (z)) || \
(RBIMPL_COMPILER_IS(GCC) && \
((RBIMPL_COMPILER_VERSION_MAJOR == (x)) && \
((RBIMPL_COMPILER_VERSION_MINOR == (y)) && \
(RBIMPL_COMPILER_VERSION_PATCH == (z))))))
#endif
#endif /* RUBY_BACKWARD2_GCC_VERSION_SINCE_H */

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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
@ -29,21 +29,21 @@
#include "ruby/impl/has/warning.h"
#include "ruby/impl/warning_push.h"
#if RUBY3_HAS_WARNING("-Wc++11-long-long")
#if RBIMPL_HAS_WARNING("-Wc++11-long-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RUBY3_WARNING_PUSH() \
RUBY3_WARNING_IGNORED(-Wc++11-long-long) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wc++11-long-long) \
long long \
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()
#elif RUBY3_HAS_WARNING("-Wlong-long")
#elif RBIMPL_HAS_WARNING("-Wlong-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RUBY3_WARNING_PUSH() \
RUBY3_WARNING_IGNORED(-Wlong-long) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wlong-long) \
long long \
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()
#elif defined(HAVE_LONG_LONG)
# define HAVE_TRUE_LONG_LONG 1
@ -62,4 +62,4 @@
# error Thank you!
#endif
#endif /* RUBY3_BACKWARD2_LONG_LONG_H */
#endif /* RBIMPL_BACKWARD2_LONG_LONG_H */

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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
@ -24,7 +24,7 @@
#undef RUBY_ALIGNAS
#undef RUBY_ALIGNOF
#define RUBY_ALIGNAS RUBY3_ALIGNAS
#define RUBY_ALIGNOF RUBY3_ALIGNOF
#define RUBY_ALIGNAS RBIMPL_ALIGNAS
#define RUBY_ALIGNOF RBIMPL_ALIGNOF
#endif /* RUBY_BACKWARD2_STDALIGN_H */

Просмотреть файл

@ -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

Просмотреть файл

@ -14,7 +14,7 @@
#include "ruby/impl/event.h"
#include "ruby/impl/value.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
/* Note: This file contains experimental APIs. */
/* APIs can be replaced at Ruby 2.0.1 or later */
@ -98,6 +98,6 @@ typedef enum {
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY_DEBUG_H */

Просмотреть файл

@ -99,9 +99,9 @@
#endif
#if defined(__sparc)
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
void rb_sparc_flush_register_windows(void);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
#else
# define FLUSH_REGISTER_WINDOWS ((void)0)

Просмотреть файл

@ -16,7 +16,7 @@
#include "ruby/oniguruma.h"
#include "ruby/impl/dllexport.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
enum ruby_encoding_consts {
RUBY_ENCODING_INLINE_MAX = 127,
@ -406,6 +406,6 @@ enum ruby_econv_flag_type {
/* end of flags for rb_econv_convert */
RUBY_ECONV_FLAGS_PLACEHOLDER};
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY_ENCODING_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ANYARGS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ANYARGS_H
#ifndef RBIMPL_ANYARGS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ANYARGS_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
@ -85,7 +85,7 @@
#elif defined(_WIN32) || defined(__CYGWIN__)
# /* Skip due to [Bug #16134] */
#elif ! RUBY3_HAS_ATTRIBUTE(transparent_union)
#elif ! RBIMPL_HAS_ATTRIBUTE(transparent_union)
# /* :TODO: improve here, please find a way to support. */
#elif ! defined(HAVE_VA_ARGS_MACRO)
@ -94,18 +94,18 @@
#else
# /** @cond INTERNAL_MACRO */
# if ! defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P)
# define RUBY3_CFUNC_IS_rb_f_notimplement(f) 0
# define RBIMPL_CFUNC_IS_rb_f_notimplement(f) 0
# else
# define RUBY3_CFUNC_IS_rb_f_notimplement(f) \
# define RBIMPL_CFUNC_IS_rb_f_notimplement(f) \
__builtin_types_compatible_p( \
__typeof__(f), \
__typeof__(rb_f_notimplement))
# endif
# if ! defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
# define RUBY3_ANYARGS_DISPATCH(expr, truthy, falsy) (falsy)
# define RBIMPL_ANYARGS_DISPATCH(expr, truthy, falsy) (falsy)
# else
# define RUBY3_ANYARGS_DISPATCH(expr, truthy, falsy) \
# define RBIMPL_ANYARGS_DISPATCH(expr, truthy, falsy) \
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_constant_p(expr), \
@ -113,167 +113,167 @@
(truthy), (falsy))
# endif
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_singleton_method_m2, rb_define_singleton_method_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_singleton_method_m1, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_singleton_method_00, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_singleton_method_01, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_singleton_method_02, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_singleton_method_03, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_singleton_method_04, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_singleton_method_05, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_singleton_method_06, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_singleton_method_07, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_singleton_method_08, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_singleton_method_09, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_singleton_method_10, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_singleton_method_11, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_singleton_method_12, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_singleton_method_13, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_singleton_method_14, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_singleton_method_15, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_protected_method_m2, rb_define_protected_method_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_protected_method_m1, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_protected_method_00, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_protected_method_01, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_protected_method_02, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_protected_method_03, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_protected_method_04, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_protected_method_05, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_protected_method_06, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_protected_method_07, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_protected_method_08, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_protected_method_09, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_protected_method_10, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_protected_method_11, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_protected_method_12, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_protected_method_13, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_protected_method_14, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_protected_method_15, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_private_method_m2, rb_define_private_method_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_private_method_m1, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_private_method_00, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_private_method_01, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_private_method_02, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_private_method_03, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_private_method_04, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_private_method_05, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_private_method_06, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_private_method_07, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_private_method_08, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_private_method_09, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_private_method_10, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_private_method_11, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_private_method_12, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_private_method_13, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_private_method_14, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_private_method_15, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_module_function_m2, rb_define_module_function_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_module_function_m1, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_module_function_00, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_module_function_01, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_module_function_02, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_module_function_03, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_module_function_04, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_module_function_05, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_module_function_06, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_module_function_07, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_module_function_08, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_module_function_09, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_module_function_10, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_module_function_11, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_module_function_12, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_module_function_13, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_module_function_14, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_module_function_15, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_global_function_m2, rb_define_global_function_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_global_function_m1, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_global_function_00, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_global_function_01, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_global_function_02, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_global_function_03, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_global_function_04, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_global_function_05, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_global_function_06, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_global_function_07, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_global_function_08, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_global_function_09, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_global_function_10, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_global_function_11, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_global_function_12, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_global_function_13, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_global_function_14, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_global_function_15, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_method_id_m2, rb_define_method_id_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_method_id_m1, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_method_id_00, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_method_id_01, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_method_id_02, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_method_id_03, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_method_id_04, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_method_id_05, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_method_id_06, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_method_id_07, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_method_id_08, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_method_id_09, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_method_id_10, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_method_id_11, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_method_id_12, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_method_id_13, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_method_id_14, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_method_id_15, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_m2(n) RUBY3_ANYARGS_DISPATCH((n) == -2, rb_define_method_m2, rb_define_method_m3)
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_m1(n) RUBY3_ANYARGS_DISPATCH((n) == -1, rb_define_method_m1, RUBY3_ANYARGS_DISPATCH_rb_define_method_m2(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_00(n) RUBY3_ANYARGS_DISPATCH((n) == 0, rb_define_method_00, RUBY3_ANYARGS_DISPATCH_rb_define_method_m1(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_01(n) RUBY3_ANYARGS_DISPATCH((n) == 1, rb_define_method_01, RUBY3_ANYARGS_DISPATCH_rb_define_method_00(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_02(n) RUBY3_ANYARGS_DISPATCH((n) == 2, rb_define_method_02, RUBY3_ANYARGS_DISPATCH_rb_define_method_01(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_03(n) RUBY3_ANYARGS_DISPATCH((n) == 3, rb_define_method_03, RUBY3_ANYARGS_DISPATCH_rb_define_method_02(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_04(n) RUBY3_ANYARGS_DISPATCH((n) == 4, rb_define_method_04, RUBY3_ANYARGS_DISPATCH_rb_define_method_03(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_05(n) RUBY3_ANYARGS_DISPATCH((n) == 5, rb_define_method_05, RUBY3_ANYARGS_DISPATCH_rb_define_method_04(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_06(n) RUBY3_ANYARGS_DISPATCH((n) == 6, rb_define_method_06, RUBY3_ANYARGS_DISPATCH_rb_define_method_05(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_07(n) RUBY3_ANYARGS_DISPATCH((n) == 7, rb_define_method_07, RUBY3_ANYARGS_DISPATCH_rb_define_method_06(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_08(n) RUBY3_ANYARGS_DISPATCH((n) == 8, rb_define_method_08, RUBY3_ANYARGS_DISPATCH_rb_define_method_07(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_09(n) RUBY3_ANYARGS_DISPATCH((n) == 9, rb_define_method_09, RUBY3_ANYARGS_DISPATCH_rb_define_method_08(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_10(n) RUBY3_ANYARGS_DISPATCH((n) == 10, rb_define_method_10, RUBY3_ANYARGS_DISPATCH_rb_define_method_09(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_11(n) RUBY3_ANYARGS_DISPATCH((n) == 11, rb_define_method_11, RUBY3_ANYARGS_DISPATCH_rb_define_method_10(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_12(n) RUBY3_ANYARGS_DISPATCH((n) == 12, rb_define_method_12, RUBY3_ANYARGS_DISPATCH_rb_define_method_11(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_13(n) RUBY3_ANYARGS_DISPATCH((n) == 13, rb_define_method_13, RUBY3_ANYARGS_DISPATCH_rb_define_method_12(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_14(n) RUBY3_ANYARGS_DISPATCH((n) == 14, rb_define_method_14, RUBY3_ANYARGS_DISPATCH_rb_define_method_13(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_15(n) RUBY3_ANYARGS_DISPATCH((n) == 15, rb_define_method_15, RUBY3_ANYARGS_DISPATCH_rb_define_method_14(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_singleton_method_m3, RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method_15(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_protected_method(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_protected_method_m3, RUBY3_ANYARGS_DISPATCH_rb_define_protected_method_15(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_private_method(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_private_method_m3, RUBY3_ANYARGS_DISPATCH_rb_define_private_method_15(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_module_function(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_module_function_m3, RUBY3_ANYARGS_DISPATCH_rb_define_module_function_15(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_global_function(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_global_function_m3, RUBY3_ANYARGS_DISPATCH_rb_define_global_function_15(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method_id(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_method_id_m3, RUBY3_ANYARGS_DISPATCH_rb_define_method_id_15(n))
# define RUBY3_ANYARGS_DISPATCH_rb_define_method(n, f) RUBY3_ANYARGS_DISPATCH(RUBY3_CFUNC_IS_rb_f_notimplement(f), rb_define_method_m3, RUBY3_ANYARGS_DISPATCH_rb_define_method_15(n))
# define RUBY3_ANYARGS_ATTRSET(sym) RUBY3_ATTR_MAYBE_UNUSED() RUBY3_ATTR_NONNULL() RUBY3_ATTR_WEAKREF(sym)
# define RUBY3_ANYARGS_DECL(sym, ...) \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _m3(__VA_ARGS__, VALUE(*)(ANYARGS), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _m2(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _m1(__VA_ARGS__, VALUE(*)(int, union { VALUE *x; const VALUE *y; } __attribute__((__transparent_union__)), VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _02(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _03(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _04(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _05(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _06(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _07(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _08(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _09(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _10(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _11(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _12(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _13(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _14(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RUBY3_ANYARGS_ATTRSET(sym) static void sym ## _15(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int);
RUBY3_ANYARGS_DECL(rb_define_singleton_method, VALUE, const char *)
RUBY3_ANYARGS_DECL(rb_define_protected_method, VALUE, const char *)
RUBY3_ANYARGS_DECL(rb_define_private_method, VALUE, const char *)
RUBY3_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
RUBY3_ANYARGS_DECL(rb_define_global_function, const char *)
RUBY3_ANYARGS_DECL(rb_define_method_id, VALUE, ID)
RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_singleton_method_m2, rb_define_singleton_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_singleton_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_singleton_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_singleton_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_singleton_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_singleton_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_singleton_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_singleton_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_singleton_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_singleton_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_singleton_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_singleton_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_singleton_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_singleton_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_singleton_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_singleton_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_singleton_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_singleton_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_protected_method_m2, rb_define_protected_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_protected_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_protected_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_protected_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_protected_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_protected_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_protected_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_protected_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_protected_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_protected_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_protected_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_protected_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_protected_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_protected_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_protected_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_protected_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_protected_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_protected_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_private_method_m2, rb_define_private_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_private_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_private_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_private_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_private_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_private_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_private_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_private_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_private_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_private_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_private_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_private_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_private_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_private_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_private_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_private_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_private_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_private_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_module_function_m2, rb_define_module_function_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_module_function_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_module_function_00, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_module_function_01, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_module_function_02, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_module_function_03, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_module_function_04, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_module_function_05, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_module_function_06, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_module_function_07, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_module_function_08, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_module_function_09, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_module_function_10, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_module_function_11, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_module_function_12, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_module_function_13, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_module_function_14, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_module_function_15, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_global_function_m2, rb_define_global_function_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_global_function_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_global_function_00, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_global_function_01, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_global_function_02, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_global_function_03, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_global_function_04, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_global_function_05, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_global_function_06, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_global_function_07, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_global_function_08, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_global_function_09, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_global_function_10, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_global_function_11, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_global_function_12, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_global_function_13, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_global_function_14, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_global_function_15, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_method_id_m2, rb_define_method_id_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_method_id_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_method_id_00, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_method_id_01, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_method_id_02, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_method_id_03, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_method_id_04, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_method_id_05, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_method_id_06, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_method_id_07, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_method_id_08, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_method_id_09, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_method_id_10, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_method_id_11, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_method_id_12, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_method_id_13, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_method_id_14, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_method_id_15, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_method_m2, rb_define_method_m3)
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_method_m2(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_method_m1(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_method_00(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_method_01(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_method_02(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_method_03(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_method_04(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_method_05(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_method_06(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_method_07(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_method_08(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_method_09(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_method_10(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_method_11(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_method_12(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_method_13(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_method_14(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_singleton_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_protected_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_private_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_module_function_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_global_function_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_method_id_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_15(n))
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_method_15(n))
# define RBIMPL_ANYARGS_ATTRSET(sym) RBIMPL_ATTR_MAYBE_UNUSED() RBIMPL_ATTR_NONNULL() RBIMPL_ATTR_WEAKREF(sym)
# define RBIMPL_ANYARGS_DECL(sym, ...) \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m3(__VA_ARGS__, VALUE(*)(ANYARGS), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m2(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m1(__VA_ARGS__, VALUE(*)(int, union { VALUE *x; const VALUE *y; } __attribute__((__transparent_union__)), VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _02(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _03(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _04(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _05(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _06(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _07(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _08(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _09(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _10(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _11(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _12(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _13(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _14(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _15(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int);
RBIMPL_ANYARGS_DECL(rb_define_singleton_method, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_protected_method, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_private_method, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
RBIMPL_ANYARGS_DECL(rb_define_global_function, const char *)
RBIMPL_ANYARGS_DECL(rb_define_method_id, VALUE, ID)
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
/** @endcond */
/**
@ -284,7 +284,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_method(klass, mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
#define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines klass\#mid.
@ -294,7 +294,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_method_id(klass, mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_method_id((arity), (func))((klass), (mid), (func), (arity))
#define rb_define_method_id(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method_id((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines obj.mid.
@ -304,7 +304,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of obj.mid.
* @param arity Arity of obj.mid.
*/
#define rb_define_singleton_method(obj, mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj), (mid), (func), (arity))
#define rb_define_singleton_method(obj, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj), (mid), (func), (arity))
/**
* @brief Defines klass\#mid and make it protected.
@ -314,7 +314,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_protected_method(klass, mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_protected_method((arity), (func))((klass), (mid), (func), (arity))
#define rb_define_protected_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines klass\#mid and make it private.
@ -324,7 +324,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of klass\#mid.
* @param arity Arity of klass\#mid.
*/
#define rb_define_private_method(klass, mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_private_method((arity), (func))((klass), (mid), (func), (arity))
#define rb_define_private_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_private_method((arity), (func))((klass), (mid), (func), (arity))
/**
* @brief Defines mod\#mid and make it a module function.
@ -334,7 +334,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of mod\#mid.
* @param arity Arity of mod\#mid.
*/
#define rb_define_module_function(mod, mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
#define rb_define_module_function(mod, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
/**
* @brief Defines ::rb_mKerbel \#mid.
@ -343,7 +343,7 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func Implementation of ::rb_mKernel \#mid.
* @param arity Arity of ::rb_mKernel \#mid.
*/
#define rb_define_global_function(mid, func, arity) RUBY3_ANYARGS_DISPATCH_rb_define_global_function((arity), (func))((mid), (func), (arity))
#define rb_define_global_function(mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_global_function((arity), (func))((mid), (func), (arity))
#endif /* __cplusplus */
@ -359,17 +359,17 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
* @param func A pointer to a function that implements a method.
*/
#if ! defined(RUBY_DEVEL)
# define RUBY_METHOD_FUNC(func) RUBY3_CAST((VALUE (*)(ANYARGS))(func))
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
#elif ! RUBY_DEVEL
# define RUBY_METHOD_FUNC(func) RUBY3_CAST((VALUE (*)(ANYARGS))(func))
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
#elif ! defined(rb_define_method)
# define RUBY_METHOD_FUNC(func) RUBY3_CAST((VALUE (*)(ANYARGS))(func))
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
#else
# define RUBY_METHOD_FUNC(func) (func)
#endif
#endif /* RUBY3_ANYARGS_H */
#endif /* RBIMPL_ANYARGS_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_H
#ifndef RBIMPL_ARITHMETIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_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
@ -35,4 +35,4 @@
#include "ruby/impl/arithmetic/size_t.h"
#include "ruby/impl/arithmetic/st_data_t.h"
#include "ruby/impl/arithmetic/uid_t.h"
#endif /* RUBY3_ARITHMETIC_H */
#endif /* RBIMPL_ARITHMETIC_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_CHAR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_CHAR_H
#ifndef RBIMPL_ARITHMETIC_CHAR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_CHAR_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
@ -37,9 +37,9 @@
#define RB_CHR2FIX RB_CHR2FIX
/** @endcond */
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RB_CHR2FIX(unsigned char c)
{
@ -52,7 +52,7 @@ rb_num2char_inline(VALUE x)
if (RB_TYPE_P(x, RUBY_T_STRING) && (RSTRING_LEN(x)>=1))
return RSTRING_PTR(x)[0];
else
return RUBY3_CAST((char)RB_NUM2INT(x));
return RBIMPL_CAST((char)RB_NUM2INT(x));
}
#endif /* RUBY3_ARITHMETIC_CHAR_H */
#endif /* RBIMPL_ARITHMETIC_CHAR_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_DOUBLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_DOUBLE_H
#ifndef RBIMPL_ARITHMETIC_DOUBLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_DOUBLE_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
@ -28,12 +28,12 @@
#define RFLOAT_VALUE rb_float_value
#define DBL2NUM rb_float_new
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
double rb_num2dbl(VALUE);
RUBY3_ATTR_PURE()
RBIMPL_ATTR_PURE()
double rb_float_value(VALUE);
VALUE rb_float_new(double);
VALUE rb_float_new_in_heap(double);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_ARITHMETIC_DOUBLE_H */
#endif /* RBIMPL_ARITHMETIC_DOUBLE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_FIXNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_FIXNUM_H
#ifndef RBIMPL_ARITHMETIC_FIXNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_FIXNUM_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
@ -41,4 +41,4 @@
#define RUBY_FIXNUM_MAX (LONG_MAX / 2)
#define RUBY_FIXNUM_MIN (LONG_MIN / 2)
#endif /* RUBY3_ARITHMETIC_FIXNUM_H */
#endif /* RBIMPL_ARITHMETIC_FIXNUM_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_GID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_GID_T_H
#ifndef RBIMPL_ARITHMETIC_GID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_GID_T_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
@ -31,4 +31,4 @@
# define NUM2GIDT RB_NUM2LONG
#endif
#endif /* RUBY3_ARITHMETIC_GID_T_H */
#endif /* RBIMPL_ARITHMETIC_GID_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_INT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_INT_H
#ifndef RBIMPL_ARITHMETIC_INT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_INT_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
@ -51,14 +51,14 @@
#define RB_FIX2UINT RB_FIX2UINT
/** @endcond */
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
long rb_num2int(VALUE);
long rb_fix2int(VALUE);
unsigned long rb_num2uint(VALUE);
unsigned long rb_fix2uint(VALUE);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline int
RB_FIX2INT(VALUE x)
{
@ -66,7 +66,7 @@ RB_FIX2INT(VALUE x)
* that is a desired behaviour but just preserve backwards compatilibily.
*/
#if 0
RUBY3_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
#endif
long ret;
@ -77,7 +77,7 @@ RB_FIX2INT(VALUE x)
ret = RB_FIX2LONG(x);
}
return RUBY3_CAST((int)ret);
return RBIMPL_CAST((int)ret);
}
static inline int
@ -95,10 +95,10 @@ rb_num2int_inline(VALUE x)
ret = rb_num2int(x);
}
return RUBY3_CAST((int)ret);
return RBIMPL_CAST((int)ret);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline unsigned int
RB_NUM2UINT(VALUE x)
{
@ -111,15 +111,15 @@ RB_NUM2UINT(VALUE x)
ret = RB_NUM2ULONG(x);
}
return RUBY3_CAST((unsigned int)ret);
return RBIMPL_CAST((unsigned int)ret);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline unsigned int
RB_FIX2UINT(VALUE x)
{
#if 0 /* Ditto for RB_FIX2INT. */
RUBY3_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
#endif
unsigned long ret;
@ -130,14 +130,14 @@ RB_FIX2UINT(VALUE x)
ret = RB_FIX2ULONG(x);
}
return RUBY3_CAST((unsigned int)ret);
return RBIMPL_CAST((unsigned int)ret);
}
RUBY3_WARNING_PUSH()
#if RUBY3_COMPILER_IS(GCC)
RUBY3_WARNING_IGNORED(-Wtype-limits) /* We can ignore them here. */
#elif RUBY3_HAS_WARNING("-Wtautological-constant-out-of-range-compare")
RUBY3_WARNING_IGNORED(-Wtautological-constant-out-of-range-compare)
RBIMPL_WARNING_PUSH()
#if RBIMPL_COMPILER_IS(GCC)
RBIMPL_WARNING_IGNORED(-Wtype-limits) /* We can ignore them here. */
#elif RBIMPL_HAS_WARNING("-Wtautological-constant-out-of-range-compare")
RBIMPL_WARNING_IGNORED(-Wtautological-constant-out-of-range-compare)
#endif
static inline VALUE
@ -158,6 +158,6 @@ rb_uint2num_inline(unsigned int v)
return rb_uint2big(v);
}
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()
#endif /* RUBY3_ARITHMETIC_INT_H */
#endif /* RBIMPL_ARITHMETIC_INT_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_INTPTR_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_INTPTR_T_H
#ifndef RBIMPL_ARITHMETIC_INTPTR_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_INTPTR_T_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
@ -32,11 +32,11 @@
#define rb_int_new rb_int2inum
#define rb_uint_new rb_uint2inum
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_int2big(intptr_t i);
VALUE rb_int2inum(intptr_t i);
VALUE rb_uint2big(uintptr_t i);
VALUE rb_uint2inum(uintptr_t i);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_ARITHMETIC_INTPTR_T_H */
#endif /* RBIMPL_ARITHMETIC_INTPTR_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_LONG_H
#ifndef RBIMPL_ARITHMETIC_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_LONG_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
@ -65,23 +65,23 @@
#define RB_INT2FIX RB_INT2FIX
/** @endcond */
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
RUBY3_ATTR_NORETURN()
RUBY3_ATTR_COLD()
RBIMPL_ATTR_NORETURN()
RBIMPL_ATTR_COLD()
void rb_out_of_int(SIGNED_VALUE num);
long rb_num2long(VALUE num);
unsigned long rb_num2ulong(VALUE num);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RB_INT2FIX(long i)
{
RUBY3_ASSERT_OR_ASSUME(RB_FIXABLE(i));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(i));
/* :NOTE: VALUE can be wider than long. As j being unsigned, 2j+1 is fully
* defined. Also it can be compiled into a single LEA instruction. */
@ -91,17 +91,17 @@ RB_INT2FIX(long i)
const SIGNED_VALUE m = l; /* Sign extend */
const VALUE n = m;
RUBY3_ASSERT_OR_ASSUME(RB_FIXNUM_P(n));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(n));
return n;
}
static inline int
rb_long2int_inline(long n)
{
int i = RUBY3_CAST((int)n);
int i = RBIMPL_CAST((int)n);
if /* constexpr */ (sizeof(long) <= sizeof(int)) {
RUBY3_ASSUME(i == n);
RBIMPL_ASSUME(i == n);
}
if (i != n)
@ -110,51 +110,51 @@ rb_long2int_inline(long n)
return i;
}
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
static inline long
ruby3_fix2long_by_idiv(VALUE x)
{
RUBY3_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
/* :NOTE: VALUE can be wider than long. (x-1)/2 never overflows because
* RB_FIXNUM_P(x) holds. Also it has no portability issue like y>>1
* below. */
const SIGNED_VALUE y = x - RUBY_FIXNUM_FLAG;
const SIGNED_VALUE z = y / 2;
const long w = RUBY3_CAST((long)z);
const long w = RBIMPL_CAST((long)z);
RUBY3_ASSERT_OR_ASSUME(RB_FIXABLE(w));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(w));
return w;
}
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
static inline long
ruby3_fix2long_by_shift(VALUE x)
{
RUBY3_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
/* :NOTE: VALUE can be wider than long. If right shift is arithmetic, this
* is noticeably faster than above. */
const SIGNED_VALUE y = x;
const SIGNED_VALUE z = y >> 1;
const long w = RUBY3_CAST((long)z);
const long w = RBIMPL_CAST((long)z);
RUBY3_ASSERT_OR_ASSUME(RB_FIXABLE(w));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(w));
return w;
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
static inline bool
ruby3_right_shift_is_arithmetic_p(void)
{
return (-1 >> 1) == -1;
}
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
static inline long
rb_fix2long(VALUE x)
{
@ -166,12 +166,12 @@ rb_fix2long(VALUE x)
}
}
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
static inline unsigned long
rb_fix2ulong(VALUE x)
{
RUBY3_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
RBIMPL_ASSERT_OR_ASSUME(RB_FIXNUM_P(x));
return rb_fix2long(x);
}
@ -224,21 +224,21 @@ rb_ulong2num_inline(unsigned long v)
* VALUE does not fit into an enum (which must be a signed int). But we cannot
* break existing codes.
*/
#if RUBY3_HAS_ATTR_CONSTEXPR_CXX14
#if RBIMPL_HAS_ATTR_CONSTEXPR_CXX14
# /* C++ can write constexpr as enum values. */
#elif ! defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
# undef INT2FIX
# define INT2FIX(i) (RUBY3_CAST((VALUE)(i)) << 1 | RUBY_FIXNUM_FLAG)
# define INT2FIX(i) (RBIMPL_CAST((VALUE)(i)) << 1 | RUBY_FIXNUM_FLAG)
#else
# undef INT2FIX
# define INT2FIX(i) \
__builtin_choose_expr( \
__builtin_constant_p(i), \
RUBY3_CAST((VALUE)(i)) << 1 | RUBY_FIXNUM_FLAG, \
RBIMPL_CAST((VALUE)(i)) << 1 | RUBY_FIXNUM_FLAG, \
RB_INT2FIX(i))
#endif
/** @endcond */
#endif /* RUBY3_ARITHMETIC_LONG_H */
#endif /* RBIMPL_ARITHMETIC_LONG_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_LONG_LONG_H
#ifndef RBIMPL_ARITHMETIC_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_LONG_LONG_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
@ -34,12 +34,12 @@
#define NUM2LL RB_NUM2LL
#define NUM2ULL RB_NUM2ULL
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_ll2inum(LONG_LONG);
VALUE rb_ull2inum(unsigned LONG_LONG);
LONG_LONG rb_num2ll(VALUE);
unsigned LONG_LONG rb_num2ull(VALUE);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
static inline LONG_LONG
rb_num2ll_inline(VALUE x)
@ -50,4 +50,4 @@ rb_num2ll_inline(VALUE x)
return rb_num2ll(x);
}
#endif /* RUBY3_ARITHMETIC_LONG_LONG_H */
#endif /* RBIMPL_ARITHMETIC_LONG_LONG_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_MODE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_MODE_T_H
#ifndef RBIMPL_ARITHMETIC_MODE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_MODE_T_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
@ -31,4 +31,4 @@
# define MODET2NUM RB_INT2NUM
#endif
#endif /* RUBY3_ARITHMETIC_MODE_T_H */
#endif /* RBIMPL_ARITHMETIC_MODE_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_OFF_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_OFF_T_H
#ifndef RBIMPL_ARITHMETIC_OFF_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_OFF_T_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
@ -46,4 +46,4 @@
# define NUM2OFFT RB_NUM2INT
#endif
#endif /* RUBY3_ARITHMETIC_OFF_T_H */
#endif /* RBIMPL_ARITHMETIC_OFF_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_PID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_PID_T_H
#ifndef RBIMPL_ARITHMETIC_PID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_PID_T_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
@ -31,4 +31,4 @@
# define NUM2PIDT RB_NUM2LONG
#endif
#endif /* RUBY3_ARITHMETIC_PID_T_H */
#endif /* RBIMPL_ARITHMETIC_PID_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_SHORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_SHORT_H
#ifndef RBIMPL_ARITHMETIC_SHORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_SHORT_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
@ -35,12 +35,12 @@
#define RB_FIX2SHORT rb_fix2short
#define FIX2SHORT RB_FIX2SHORT
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
short rb_num2short(VALUE);
unsigned short rb_num2ushort(VALUE);
short rb_fix2short(VALUE);
unsigned short rb_fix2ushort(VALUE);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
static inline short
rb_num2short_inline(VALUE x)
@ -51,4 +51,4 @@ rb_num2short_inline(VALUE x)
return rb_num2short(x);
}
#endif /* RUBY3_ARITHMETIC_SOHRT_H */
#endif /* RBIMPL_ARITHMETIC_SOHRT_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_SIZE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_SIZE_T_H
#ifndef RBIMPL_ARITHMETIC_SIZE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_SIZE_T_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
@ -48,4 +48,4 @@
# define NUM2SSIZET RB_NUM2INT
#endif
#endif /* RUBY3_ARITHMETIC_SIZE_T_H */
#endif /* RBIMPL_ARITHMETIC_SIZE_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMERIC_ST_DATA_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMERIC_ST_DATA_T_H
#ifndef RBIMPL_ARITHMERIC_ST_DATA_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMERIC_ST_DATA_T_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
@ -35,9 +35,9 @@
#define RB_ST2FIX RB_ST2FIX
/** @endcond */
RUBY3_ATTR_CONST_ON_NDEBUG()
RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST_ON_NDEBUG()
RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(CXX14)
RBIMPL_ATTR_ARTIFICIAL()
/* See also [ruby-core:84395] [Bug #14218] [ruby-core:82687] [Bug #13877] */
static inline VALUE
RB_ST2FIX(st_data_t i)
@ -51,9 +51,9 @@ RB_ST2FIX(st_data_t i)
x |= RUBY_FIXNUM_MIN;
}
RUBY3_ASSERT_OR_ASSUME(RB_FIXABLE(x));
unsigned long y = RUBY3_CAST((unsigned long)x);
RBIMPL_ASSERT_OR_ASSUME(RB_FIXABLE(x));
unsigned long y = RBIMPL_CAST((unsigned long)x);
return RB_LONG2FIX(y);
}
#endif /* RUBY3_ARITHMERIC_ST_DATA_T_H */
#endif /* RBIMPL_ARITHMERIC_ST_DATA_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ARITHMETIC_UID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_UID_T_H
#ifndef RBIMPL_ARITHMETIC_UID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ARITHMETIC_UID_T_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
@ -31,4 +31,4 @@
# define NUM2UIDT RB_NUM2LONG
#endif
#endif /* RUBY3_ARITHMETIC_UID_T_H */
#endif /* RBIMPL_ARITHMETIC_UID_T_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ASSUME_H
#ifndef RBIMPL_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ASSUME_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,12 +18,12 @@
* 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_ASSUME / #RUBY3_UNREACHABLE.
* @brief Defines #RBIMPL_ASSUME / #RBIMPL_UNREACHABLE.
*
* These macros must be defined at once because:
*
* - #RUBY3_ASSUME could fallback to #RUBY3_UNREACHABLE.
* - #RUBY3_UNREACHABLE could fallback to #RUBY3_ASSUME.
* - #RBIMPL_ASSUME could fallback to #RBIMPL_UNREACHABLE.
* - #RBIMPL_UNREACHABLE could fallback to #RBIMPL_ASSUME.
*/
#include "ruby/impl/config.h"
#include "ruby/impl/cast.h"
@ -32,59 +32,59 @@
#include "ruby/impl/warning_push.h"
/** @cond INTERNAL_MACRO */
#if RUBY3_COMPILER_SINCE(MSVC, 13, 10, 0)
# define RUBY3_HAVE___ASSUME
#if RBIMPL_COMPILER_SINCE(MSVC, 13, 10, 0)
# define RBIMPL_HAVE___ASSUME
#elif RUBY3_COMPILER_SINCE(Intel, 13, 0, 0)
# define RUBY3_HAVE___ASSUME
#elif RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
# define RBIMPL_HAVE___ASSUME
#endif
/** @endcond */
/** Wraps (or simulates) `__builtin_unreachable`. */
#if RUBY3_HAS_BUILTIN(__builtin_unreachable)
# define RUBY3_UNREACHABLE_RETURN(_) __builtin_unreachable()
#if RBIMPL_HAS_BUILTIN(__builtin_unreachable)
# define RBIMPL_UNREACHABLE_RETURN(_) __builtin_unreachable()
#elif defined(RUBY3_HAVE___ASSUME)
# define RUBY3_UNREACHABLE_RETURN(_) return (__assume(0), (_))
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_UNREACHABLE_RETURN(_) return (__assume(0), (_))
#else
# define RUBY3_UNREACHABLE_RETURN(_) return (_)
# define RBIMPL_UNREACHABLE_RETURN(_) return (_)
#endif
/** Wraps (or simulates) `__builtin_unreachable`. */
#if RUBY3_HAS_BUILTIN(__builtin_unreachable)
# define RUBY3_UNREACHABLE __builtin_unreachable
#if RBIMPL_HAS_BUILTIN(__builtin_unreachable)
# define RBIMPL_UNREACHABLE __builtin_unreachable
#elif defined(RUBY3_HAVE___ASSUME)
# define RUBY3_UNREACHABLE() __assume(0)
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_UNREACHABLE() __assume(0)
#endif
/** Wraps (or simulates) `__assume`. */
#if RUBY3_COMPILER_SINCE(Intel, 13, 0, 0)
#if RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
# /* icc warnings are false positives. Ignore them. */
# /* "warning #2261: __assume expression with side effects discarded" */
# define RUBY3_ASSUME(expr) \
RUBY3_WARNING_PUSH() \
RUBY3_WARNING_IGNORED(2261) \
# define RBIMPL_ASSUME(expr) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(2261) \
__assume(expr) \
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()
#elif defined(RUBY3_HAVE___ASSUME)
# define RUBY3_ASSUME __assume
#elif defined(RBIMPL_HAVE___ASSUME)
# define RBIMPL_ASSUME __assume
#elif RUBY3_HAS_BUILTIN(__builtin_assume)
# define RUBY3_ASSUME __builtin_assume
#elif RBIMPL_HAS_BUILTIN(__builtin_assume)
# define RBIMPL_ASSUME __builtin_assume
#elif ! defined(RUBY3_UNREACHABLE)
# define RUBY3_ASSUME(_) RUBY3_CAST((void)(_))
#elif ! defined(RBIMPL_UNREACHABLE)
# define RBIMPL_ASSUME(_) RBIMPL_CAST((void)(_))
#else
# define RUBY3_ASSUME(_) \
(RB_LIKELY(!!(_)) ? RUBY3_CAST((void)0) : RUBY3_UNREACHABLE())
# define RBIMPL_ASSUME(_) \
(RB_LIKELY(!!(_)) ? RBIMPL_CAST((void)0) : RBIMPL_UNREACHABLE())
#endif
#if ! defined(RUBY3_UNREACHABLE)
# define RUBY3_UNREACHABLE() RUBY3_ASSUME(0)
#if ! defined(RBIMPL_UNREACHABLE)
# define RBIMPL_UNREACHABLE() RBIMPL_ASSUME(0)
#endif
#endif /* RUBY3_ASSUME_H */
#endif /* RBIMPL_ASSUME_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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CAST_H
#ifndef RBIMPL_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_CAST_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_CAST.
* @brief Defines RBIMPL_CAST.
* @cond INTERNAL_MACRO
*
* This casting macro makes sense only inside of other macros that are part of
@ -30,24 +30,24 @@
#include "ruby/impl/warning_push.h"
#if ! defined(__cplusplus)
# define RUBY3_CAST(expr) (expr)
# define RBIMPL_CAST(expr) (expr)
#elif RUBY3_COMPILER_SINCE(GCC, 4, 6, 0)
#elif RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
# /* g++ has -Wold-style-cast since 1997 or so, but its _Pragma is broken. */
# /* See https://gcc.godbolt.org/z/XWhU6J */
# define RUBY3_CAST(expr) (expr)
# define RBIMPL_CAST(expr) (expr)
# pragma GCC diagnostic ignored "-Wold-style-cast"
#elif RUBY3_HAS_WARNING("-Wold-style-cast")
# define RUBY3_CAST(expr) \
RUBY3_WARNING_PUSH() \
RUBY3_WARNING_IGNORED(-Wold-style-cast) \
#elif RBIMPL_HAS_WARNING("-Wold-style-cast")
# define RBIMPL_CAST(expr) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wold-style-cast) \
(expr) \
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()
#else
# define RUBY3_CAST(expr) (expr)
# define RBIMPL_CAST(expr) (expr)
#endif
/** @endcond */
#endif /* RUBY3_CAST_H */
#endif /* RBIMPL_CAST_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_H
#ifndef RBIMPL_COMPILER_IS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_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_COMPILER_IS.
* @brief Defines #RBIMPL_COMPILER_IS.
*/
/**
@ -27,7 +27,7 @@
* @retval true It is.
* @retval false It isn't.
*/
#define RUBY3_COMPILER_IS(cc) RUBY3_COMPILER_IS_ ## cc
#define RBIMPL_COMPILER_IS(cc) RBIMPL_COMPILER_IS_ ## cc
#include "ruby/impl/compiler_is/apple.h"
#include "ruby/impl/compiler_is/clang.h"
@ -42,4 +42,4 @@
*
* - ARM's armclang: ditto, it can be clang-backended. */
#endif /* RUBY3_COMPILER_IS_H */
#endif /* RBIMPL_COMPILER_IS_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_APPLE_H
#ifndef RBIMPL_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_APPLE_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_COMPILER_IS_Apple.
* @brief Defines #RBIMPL_COMPILER_IS_Apple.
*
* Apple ships clang. Problem is, its `__clang_major__` etc. are not the
* upstream LLVM version, but XCode's. We have to think Apple's is distinct
@ -26,16 +26,16 @@
* file.
*/
#if ! defined(__clang__)
# define RUBY3_COMPILER_IS_Apple 0
# define RBIMPL_COMPILER_IS_Apple 0
#elif ! defined(__apple_build_version__)
# define RUBY3_COMPILER_IS_Apple 0
# define RBIMPL_COMPILER_IS_Apple 0
#else
# define RUBY3_COMPILER_IS_Apple 1
# define RUBY3_COMPILER_VERSION_MAJOR __clang_major__
# define RUBY3_COMPILER_VERSION_MINOR __clang_minor__
# define RUBY3_COMPILER_VERSION_PATCH __clang_patchlevel__
# define RBIMPL_COMPILER_IS_Apple 1
# define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
# define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
# define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
#endif /* RUBY3_COMPILER_IS_APPLE_H */
#endif /* RBIMPL_COMPILER_IS_APPLE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_CLANG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_CLANG_H
#ifndef RBIMPL_COMPILER_IS_CLANG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_CLANG_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_COMPILER_IS_Clang.
* @brief Defines #RBIMPL_COMPILER_IS_Clang.
*/
#include "ruby/impl/compiler_is/apple.h"
#if ! defined(__clang__)
# define RUBY3_COMPILER_IS_Clang 0
# define RBIMPL_COMPILER_IS_Clang 0
#elif RUBY3_COMPILER_IS(Apple)
# define RUBY3_COMPILER_IS_Clang 0
#elif RBIMPL_COMPILER_IS(Apple)
# define RBIMPL_COMPILER_IS_Clang 0
#else
# define RUBY3_COMPILER_IS_Clang 1
# define RUBY3_COMPILER_VERSION_MAJOR __clang_major__
# define RUBY3_COMPILER_VERSION_MINOR __clang_minor__
# define RUBY3_COMPILER_VERSION_PATCH __clang_patchlevel__
# define RBIMPL_COMPILER_IS_Clang 1
# define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
# define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
# define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
#endif /* RUBY3_COMPILER_IS_CLANG_H */
#endif /* RBIMPL_COMPILER_IS_CLANG_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_GCC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_GCC_H
#ifndef RBIMPL_COMPILER_IS_GCC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_GCC_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_COMPILER_IS_GCC.
* @brief Defines #RBIMPL_COMPILER_IS_GCC.
*/
#include "ruby/impl/compiler_is/apple.h"
#include "ruby/impl/compiler_is/clang.h"
#include "ruby/impl/compiler_is/intel.h"
#if ! defined(__GNUC__)
# define RUBY3_COMPILER_IS_GCC 0
# define RBIMPL_COMPILER_IS_GCC 0
#elif RUBY3_COMPILER_IS(Apple)
# define RUBY3_COMPILER_IS_GCC 0
#elif RBIMPL_COMPILER_IS(Apple)
# define RBIMPL_COMPILER_IS_GCC 0
#elif RUBY3_COMPILER_IS(Clang)
# define RUBY3_COMPILER_IS_GCC 0
#elif RBIMPL_COMPILER_IS(Clang)
# define RBIMPL_COMPILER_IS_GCC 0
#elif RUBY3_COMPILER_IS(Intel)
# define RUBY3_COMPILER_IS_GCC 0
#elif RBIMPL_COMPILER_IS(Intel)
# define RBIMPL_COMPILER_IS_GCC 0
#else
# define RUBY3_COMPILER_IS_GCC 1
# define RUBY3_COMPILER_VERSION_MAJOR __GNUC__
# define RUBY3_COMPILER_VERSION_MINOR __GNUC_MINOR__
# define RUBY3_COMPILER_VERSION_PATCH __GNUC_PATCHLEVEL__
# define RBIMPL_COMPILER_IS_GCC 1
# define RBIMPL_COMPILER_VERSION_MAJOR __GNUC__
# define RBIMPL_COMPILER_VERSION_MINOR __GNUC_MINOR__
# define RBIMPL_COMPILER_VERSION_PATCH __GNUC_PATCHLEVEL__
#endif
#endif /* RUBY3_COMPILER_IS_GCC_H */
#endif /* RBIMPL_COMPILER_IS_GCC_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_INTEL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_INTEL_H
#ifndef RBIMPL_COMPILER_IS_INTEL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_INTEL_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,24 +18,24 @@
* 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_COMPILER_IS_Intel.
* @brief Defines #RBIMPL_COMPILER_IS_Intel.
*/
#if ! defined(__INTEL_COMPILER)
# define RUBY3_COMPILER_IS_Intel 0
# define RBIMPL_COMPILER_IS_Intel 0
#elif ! defined(__INTEL_COMPILER_UPDATE)
# define RUBY3_COMPILER_IS_Intel 1
# define RBIMPL_COMPILER_IS_Intel 1
# /* __INTEL_COMPILER = XXYZ */
# define RUBY3_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
# define RUBY3_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RUBY3_COMPILER_VERSION_PATCH (__INTEL_COMPILER % 10)
# define RBIMPL_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
# define RBIMPL_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RBIMPL_COMPILER_VERSION_PATCH (__INTEL_COMPILER % 10)
#else
# define RUBY3_COMPILER_IS_Intel 1
# define RBIMPL_COMPILER_IS_Intel 1
# /* __INTEL_COMPILER = XXYZ */
# define RUBY3_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
# define RUBY3_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RUBY3_COMPILER_VERSION_PATCH __INTEL_COMPILER_UPDATE
# define RBIMPL_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
# define RBIMPL_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RBIMPL_COMPILER_VERSION_PATCH __INTEL_COMPILER_UPDATE
#endif
#endif /* RUBY3_COMPILER_IS_INTEL_H */
#endif /* RBIMPL_COMPILER_IS_INTEL_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_MSVC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_MSVC_H
#ifndef RBIMPL_COMPILER_IS_MSVC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_MSVC_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,40 +18,40 @@
* 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_COMPILER_IS_MSVC.
* @brief Defines #RBIMPL_COMPILER_IS_MSVC.
*/
#include "ruby/impl/compiler_is/clang.h"
#include "ruby/impl/compiler_is/intel.h"
#if ! defined(_MSC_VER)
# define RUBY3_COMPILER_IS_MSVC 0
# define RBIMPL_COMPILER_IS_MSVC 0
#elif RUBY3_COMPILER_IS(Clang)
# define RUBY3_COMPILER_IS_MSVC 0
#elif RBIMPL_COMPILER_IS(Clang)
# define RBIMPL_COMPILER_IS_MSVC 0
#elif RUBY3_COMPILER_IS(Intel)
# define RUBY3_COMPILER_IS_MSVC 0
#elif RBIMPL_COMPILER_IS(Intel)
# define RBIMPL_COMPILER_IS_MSVC 0
#elif _MSC_VER >= 1400
# define RUBY3_COMPILER_IS_MSVC 1
# define RBIMPL_COMPILER_IS_MSVC 1
# /* _MSC_FULL_VER = XXYYZZZZZ */
# define RUBY3_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 10000000)
# define RUBY3_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 10000000 / 100000)
# define RUBY3_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 100000)
# define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 10000000)
# define RBIMPL_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 10000000 / 100000)
# define RBIMPL_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 100000)
#elif defined(_MSC_FULL_VER)
# define RUBY3_COMPILER_IS_MSVC 1
# define RBIMPL_COMPILER_IS_MSVC 1
# /* _MSC_FULL_VER = XXYYZZZZ */
# define RUBY3_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 1000000)
# define RUBY3_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 1000000 / 10000)
# define RUBY3_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 10000)
# define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 1000000)
# define RBIMPL_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 1000000 / 10000)
# define RBIMPL_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 10000)
#else
# define RUBY3_COMPILER_IS_MSVC 1
# define RBIMPL_COMPILER_IS_MSVC 1
# /* _MSC_VER = XXYY */
# define RUBY3_COMPILER_VERSION_MAJOR (_MSC_VER / 100)
# define RUBY3_COMPILER_VERSION_MINOR (_MSC_VER % 100)
# define RUBY3_COMPILER_VERSION_PATCH 0
# define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_VER / 100)
# define RBIMPL_COMPILER_VERSION_MINOR (_MSC_VER % 100)
# define RBIMPL_COMPILER_VERSION_PATCH 0
#endif
#endif /* RUBY3_COMPILER_IS_MSVC_H */
#endif /* RBIMPL_COMPILER_IS_MSVC_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_IS_SUNPRO_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_SUNPRO_H
#ifndef RBIMPL_COMPILER_IS_SUNPRO_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_IS_SUNPRO_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,38 +18,38 @@
* 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_COMPILER_IS_SunPro.
* @brief Defines #RBIMPL_COMPILER_IS_SunPro.
*/
#if ! (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
# define RUBY3_COMPILER_IS_SunPro 0
# define RBIMPL_COMPILER_IS_SunPro 0
#elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x5100
# define RUBY3_COMPILER_IS_SunPro 1
# define RBIMPL_COMPILER_IS_SunPro 1
# /* __SUNPRO_C = 0xXYYZ */
# define TERSE_COMPILER_VERSION_MAJOR (__SUNPRO_C >> 12)
# define TERSE_COMPILER_VERSION_MINOR ((__SUNPRO_C >> 8 & 0xF) * 10 + (__SUNPRO_C >> 4 & 0xF))
# define TERSE_COMPILER_VERSION_PATCH (__SUNPRO_C & 0xF)
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_C >> 12)
# define RBIMPL_COMPILER_VERSION_MINOR ((__SUNPRO_C >> 8 & 0xF) * 10 + (__SUNPRO_C >> 4 & 0xF))
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_C & 0xF)
#elif defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5100
# define RUBY3_COMPILER_IS_SunPro 1
# define RBIMPL_COMPILER_IS_SunPro 1
# /* __SUNPRO_CC = 0xXYYZ */
# define TERSE_COMPILER_VERSION_MAJOR (__SUNPRO_CC >> 12)
# define TERSE_COMPILER_VERSION_MINOR ((__SUNPRO_CC >> 8 & 0xF) * 10 + (__SUNPRO_CC >> 4 & 0xF))
# define TERSE_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF)
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_CC >> 12)
# define RBIMPL_COMPILER_VERSION_MINOR ((__SUNPRO_CC >> 8 & 0xF) * 10 + (__SUNPRO_CC >> 4 & 0xF))
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF)
#elif defined(__SUNPRO_C)
# define RUBY3_COMPILER_IS_SunPro 1
# define RBIMPL_COMPILER_IS_SunPro 1
# /* __SUNPRO_C = 0xXYZ */
# define TERSE_COMPILER_VERSION_MAJOR (__SUNPRO_C >> 8)
# define TERSE_COMPILER_VERSION_MINOR (__SUNPRO_C >> 4 & 0xF)
# define TERSE_COMPILER_VERSION_PATCH (__SUNPRO_C & 0xF)
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_C >> 8)
# define RBIMPL_COMPILER_VERSION_MINOR (__SUNPRO_C >> 4 & 0xF)
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_C & 0xF)
#else
# define RUBY3_COMPILER_IS_SunPro 1
# define RBIMPL_COMPILER_IS_SunPro 1
# /* __SUNPRO_CC = 0xXYZ */
# define TERSE_COMPILER_VERSION_MAJOR (__SUNPRO_CC >> 8)
# define TERSE_COMPILER_VERSION_MINOR (__SUNPRO_CC >> 4 & 0xF)
# define TERSE_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF)
# define RBIMPL_COMPILER_VERSION_MAJOR (__SUNPRO_CC >> 8)
# define RBIMPL_COMPILER_VERSION_MINOR (__SUNPRO_CC >> 4 & 0xF)
# define RBIMPL_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF)
#endif
#endif /* RUBY3_COMPILER_IS_SUNPRO_H */
#endif /* RBIMPL_COMPILER_IS_SUNPRO_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_COMPILER_SINCE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_SINCE_H
#ifndef RBIMPL_COMPILER_SINCE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_COMPILER_SINCE_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_COMPILER_SINCE.
* @brief Defines #RBIMPL_COMPILER_SINCE.
*/
#include "ruby/impl/compiler_is.h"
@ -32,13 +32,13 @@
* @retval true cc >= x.y.z.
* @retval false oherwise.
*/
#define RUBY3_COMPILER_SINCE(cc, x, y, z) \
(RUBY3_COMPILER_IS(cc) && \
((RUBY3_COMPILER_VERSION_MAJOR > (x)) || \
((RUBY3_COMPILER_VERSION_MAJOR == (x)) && \
((RUBY3_COMPILER_VERSION_MINOR > (y)) || \
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH >= (z)))))))
#define RBIMPL_COMPILER_SINCE(cc, x, y, z) \
(RBIMPL_COMPILER_IS(cc) && \
((RBIMPL_COMPILER_VERSION_MAJOR > (x)) || \
((RBIMPL_COMPILER_VERSION_MAJOR == (x)) && \
((RBIMPL_COMPILER_VERSION_MINOR > (y)) || \
((RBIMPL_COMPILER_VERSION_MINOR == (y)) && \
(RBIMPL_COMPILER_VERSION_PATCH >= (z)))))))
/**
* @brief Checks if the compiler is of given brand and is older than the
@ -50,12 +50,12 @@
* @retval true cc < x.y.z.
* @retval false oherwise.
*/
#define RUBY3_COMPILER_BEFORE(cc, x, y, z) \
(RUBY3_COMPILER_IS(cc) && \
((RUBY3_COMPILER_VERSION_MAJOR < (x)) || \
((RUBY3_COMPILER_VERSION_MAJOR == (x)) && \
((RUBY3_COMPILER_VERSION_MINOR < (y)) || \
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH < (z)))))))
#define RBIMPL_COMPILER_BEFORE(cc, x, y, z) \
(RBIMPL_COMPILER_IS(cc) && \
((RBIMPL_COMPILER_VERSION_MAJOR < (x)) || \
((RBIMPL_COMPILER_VERSION_MAJOR == (x)) && \
((RBIMPL_COMPILER_VERSION_MINOR < (y)) || \
((RBIMPL_COMPILER_VERSION_MINOR == (y)) && \
(RBIMPL_COMPILER_VERSION_PATCH < (z)))))))
#endif /* RUBY3_COMPILER_SINCE_H */
#endif /* RBIMPL_COMPILER_SINCE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_CONFIG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CONFIG_H
#ifndef RBIMPL_CONFIG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_CONFIG_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
@ -48,19 +48,19 @@
# define HAVE_VA_ARGS_MACRO
# elif defined(__INTEL_CXX11_MODE__)
# define HAVE_VA_ARGS_MACRO
# elif RUBY3_COMPILER_SINCE(MSVC, 16, 0, 0)
# elif RBIMPL_COMPILER_SINCE(MSVC, 16, 0, 0)
# define HAVE_VA_ARGS_MACRO
# else
# /* NG, not known. */
# endif
#endif
#if RUBY3_COMPILER_BEFORE(GCC, 4, 9, 0)
#if RBIMPL_COMPILER_BEFORE(GCC, 4, 9, 0)
# /* See https://bugs.ruby-lang.org/issues/14221 */
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
#endif
#if RUBY3_COMPILER_BEFORE(GCC, 5, 0, 0)
#if RBIMPL_COMPILER_BEFORE(GCC, 5, 0, 0)
# /* GCC 4.9.2 reportedly has this feature and is broken. The function is not
# * officially documented below. Seems we should not use it.
# * https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Other-Builtins.html */
@ -115,17 +115,17 @@
#else
# /* Idea taken from: https://stackoverflow.com/a/48045656 */
# define RUBY3_TEST3(q, w, e, ...) e
# define RUBY3_TEST2(...) RUBY3_TEST3(__VA_OPT__(,),1,0,0)
# define RUBY3_TEST1() RUBY3_TEST2("ruby")
# if RUBY3_TEST1()
# define RBIMPL_TEST3(q, w, e, ...) e
# define RBIMPL_TEST2(...) RBIMPL_TEST3(__VA_OPT__(,),1,0,0)
# define RBIMPL_TEST1() RBIMPL_TEST2("ruby")
# if RBIMPL_TEST1()
# define HAVE___VA_OPT__
# else
# undef HAVE___VA_OPT__
# endif
# undef RUBY3_TEST1
# undef RUBY3_TEST2
# undef RUBY3_TEST3
# undef RBIMPL_TEST1
# undef RBIMPL_TEST2
# undef RBIMPL_TEST3
#endif /* HAVE_VA_ARGS_MACRO */
#endif /* RUBY3_CONFIG_H */
#endif /* RBIMPL_CONFIG_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_CONSTANT_P_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CONSTANT_P_H
#ifndef RBIMPL_CONSTANT_P_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_CONSTANT_P_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_CONSTANT_P.
* @brief Defines #RBIMPL_CONSTANT_P.
*
* Note that __builtin_constant_p can be applicable inside of inline functions,
* according to GCC manual. Clang lacks that feature, though.
@ -28,10 +28,10 @@
*/
#include "ruby/impl/has/builtin.h"
#if RUBY3_HAS_BUILTIN(__builtin_constant_p)
# define RUBY3_CONSTANT_P(expr) __builtin_constant_p(expr)
#if RBIMPL_HAS_BUILTIN(__builtin_constant_p)
# define RBIMPL_CONSTANT_P(expr) __builtin_constant_p(expr)
#else
# define RUBY3_CONSTANT_P(expr) 0
# define RBIMPL_CONSTANT_P(expr) 0
#endif
#endif /* RUBY3_CONSTANT_P_H */
#endif /* RBIMPL_CONSTANT_P_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_CORE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CORE_H
#ifndef RBIMPL_CORE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_CORE_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
@ -32,4 +32,4 @@
#include "ruby/impl/core/rstring.h"
#include "ruby/impl/core/rstruct.h"
#include "ruby/impl/core/rtypeddata.h"
#endif /* RUBY3_CORE_H */
#endif /* RBIMPL_CORE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RARRAY_H
#ifndef RBIMPL_RARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RARRAY_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
@ -39,7 +39,7 @@
# define USE_TRANSIENT_HEAP 1
#endif
#define RARRAY(obj) RUBY3_CAST((struct RArray *)(obj))
#define RARRAY(obj) RBIMPL_CAST((struct RArray *)(obj))
#define RARRAY_EMBED_FLAG RARRAY_EMBED_FLAG
#define RARRAY_EMBED_LEN_MASK RARRAY_EMBED_LEN_MASK
#define RARRAY_EMBED_LEN_MAX RARRAY_EMBED_LEN_MAX
@ -81,7 +81,7 @@ enum ruby_rarray_flags {
enum ruby_rarray_consts {
RARRAY_EMBED_LEN_SHIFT = RUBY_FL_USHIFT + 3,
RARRAY_EMBED_LEN_MAX = RUBY3_EMBED_LEN_MAX_OF(VALUE)
RARRAY_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(VALUE)
};
struct RArray {
@ -104,33 +104,33 @@ struct RArray {
} as;
};
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE *rb_ary_ptr_use_start(VALUE ary);
void rb_ary_ptr_use_end(VALUE a);
#if USE_TRANSIENT_HEAP
void rb_ary_detransient(VALUE a);
#endif
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline long
RARRAY_EMBED_LEN(VALUE ary)
{
RUBY3_ASSERT_TYPE(ary, RUBY_T_ARRAY);
RUBY3_ASSERT_OR_ASSUME(RB_FL_ANY_RAW(ary, RARRAY_EMBED_FLAG));
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
RBIMPL_ASSERT_OR_ASSUME(RB_FL_ANY_RAW(ary, RARRAY_EMBED_FLAG));
VALUE f = RBASIC(ary)->flags;
f &= RARRAY_EMBED_LEN_MASK;
f >>= RARRAY_EMBED_LEN_SHIFT;
return RUBY3_CAST((long)f);
return RBIMPL_CAST((long)f);
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_PURE_ON_NDEBUG()
static inline long
rb_array_len(VALUE a)
{
RUBY3_ASSERT_TYPE(a, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(a, RUBY_T_ARRAY);
if (RB_FL_ANY_RAW(a, RARRAY_EMBED_FLAG)) {
return RARRAY_EMBED_LEN(a);
@ -140,19 +140,19 @@ rb_array_len(VALUE a)
}
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline int
RARRAY_LENINT(VALUE ary)
{
return rb_long2int(RARRAY_LEN(ary));
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RARRAY_TRANSIENT_P(VALUE ary)
{
RUBY3_ASSERT_TYPE(ary, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
#if USE_TRANSIENT_HEAP
return RB_FL_ANY_RAW(ary, RARRAY_TRANSIENT_FLAG);
@ -161,12 +161,12 @@ RARRAY_TRANSIENT_P(VALUE ary)
#endif
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_PURE_ON_NDEBUG()
/* internal function. do not use this function */
static inline const VALUE *
rb_array_const_ptr_transient(VALUE a)
{
RUBY3_ASSERT_TYPE(a, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(a, RUBY_T_ARRAY);
if (RB_FL_ANY_RAW(a, RARRAY_EMBED_FLAG)) {
return FIX_CONST_VALUE_PTR(RARRAY(a)->as.ary);
@ -177,13 +177,13 @@ rb_array_const_ptr_transient(VALUE a)
}
#if ! USE_TRANSIENT_HEAP
RUBY3_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_PURE_ON_NDEBUG()
#endif
/* internal function. do not use this function */
static inline const VALUE *
rb_array_const_ptr(VALUE a)
{
RUBY3_ASSERT_TYPE(a, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(a, RUBY_T_ARRAY);
#if USE_TRANSIENT_HEAP
if (RARRAY_TRANSIENT_P(a)) {
@ -196,10 +196,10 @@ rb_array_const_ptr(VALUE a)
/* internal function. do not use this function */
static inline VALUE *
rb_array_ptr_use_start(VALUE a,
RUBY3_ATTR_MAYBE_UNUSED()
RBIMPL_ATTR_MAYBE_UNUSED()
int allow_transient)
{
RUBY3_ASSERT_TYPE(a, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(a, RUBY_T_ARRAY);
#if USE_TRANSIENT_HEAP
if (!allow_transient) {
@ -215,15 +215,15 @@ rb_array_ptr_use_start(VALUE a,
/* internal function. do not use this function */
static inline void
rb_array_ptr_use_end(VALUE a,
RUBY3_ATTR_MAYBE_UNUSED()
RBIMPL_ATTR_MAYBE_UNUSED()
int allow_transient)
{
RUBY3_ASSERT_TYPE(a, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(a, RUBY_T_ARRAY);
rb_ary_ptr_use_end(a);
}
#define RUBY3_RARRAY_STMT(flag, ary, var, expr) do { \
RUBY3_ASSERT_TYPE((ary), RUBY_T_ARRAY); \
#define RBIMPL_RARRAY_STMT(flag, ary, var, expr) do { \
RBIMPL_ASSERT_TYPE((ary), RUBY_T_ARRAY); \
const VALUE ruby3_ary = (ary); \
VALUE *var = rb_array_ptr_use_start(ruby3_ary, (flag)); \
expr; \
@ -233,20 +233,20 @@ rb_array_ptr_use_end(VALUE a,
#define RARRAY_PTR_USE_START(a) rb_array_ptr_use_start(a, 0)
#define RARRAY_PTR_USE_END(a) rb_array_ptr_use_end(a, 0)
#define RARRAY_PTR_USE(ary, ptr_name, expr) \
RUBY3_RARRAY_STMT(0, ary, ptr_name, expr)
RBIMPL_RARRAY_STMT(0, ary, ptr_name, expr)
#define RARRAY_PTR_USE_START_TRANSIENT(a) rb_array_ptr_use_start(a, 1)
#define RARRAY_PTR_USE_END_TRANSIENT(a) rb_array_ptr_use_end(a, 1)
#define RARRAY_PTR_USE_TRANSIENT(ary, ptr_name, expr) \
RUBY3_RARRAY_STMT(1, ary, ptr_name, expr)
RBIMPL_RARRAY_STMT(1, ary, ptr_name, expr)
static inline VALUE *
RARRAY_PTR(VALUE ary)
{
RUBY3_ASSERT_TYPE(ary, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
VALUE tmp = RB_OBJ_WB_UNPROTECT_FOR(ARRAY, ary);
return RUBY3_CAST((VALUE *)RARRAY_CONST_PTR(tmp));
return RBIMPL_CAST((VALUE *)RARRAY_CONST_PTR(tmp));
}
static inline void
@ -258,12 +258,12 @@ RARRAY_ASET(VALUE ary, long i, VALUE v)
/* RARRAY_AREF is used as a lvalue. Cannot be a function. */
#if 0
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RARRAY_AREF(VALUE ary, long i)
{
RUBY3_ASSERT_TYPE(ary, RUBY_T_ARRAY);
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
return RARRAY_CONST_PTR_TRANSIENT(ary)[i];
}
@ -272,4 +272,4 @@ RARRAY_AREF(VALUE ary, long i)
# define RARRAY_AREF(a, i) RARRAY_CONST_PTR_TRANSIENT(a)[i]
#endif
#endif /* RUBY3_RARRAY_H */
#endif /* RBIMPL_RARRAY_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RBASIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RBASIC_H
#ifndef RBIMPL_RBASIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RBASIC_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
@ -31,13 +31,13 @@
#include "ruby/impl/value.h"
#include "ruby/assert.h"
#define RBASIC(obj) RUBY3_CAST((struct RBasic *)(obj))
#define RBASIC(obj) RBIMPL_CAST((struct RBasic *)(obj))
#define RBASIC_CLASS RBASIC_CLASS
#define RVALUE_EMBED_LEN_MAX RVALUE_EMBED_LEN_MAX
/** @cond INTERNAL_MACRO */
#define RUBY3_EMBED_LEN_MAX_OF(T) \
RUBY3_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T)))
#define RBIMPL_EMBED_LEN_MAX_OF(T) \
RBIMPL_CAST((int)(sizeof(VALUE[RVALUE_EMBED_LEN_MAX]) / sizeof(T)))
/** @endcond */
enum ruby_rvalue_flags { RVALUE_EMBED_LEN_MAX = 3 };
@ -50,10 +50,10 @@ RBasic {
#ifdef __cplusplus
public:
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RUBY3_ATTR_FORCEINLINE()
RUBY3_ATTR_NOALIAS()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_FORCEINLINE()
RBIMPL_ATTR_NOALIAS()
/**
* We need to define this explicit constructor because the field `klass` is
* const-qualified above, which effectively defines the implicit default
@ -61,25 +61,25 @@ RBasic {
* ourselves.
*/
RBasic() :
flags(RUBY3_VALUE_NULL),
klass(RUBY3_VALUE_NULL)
flags(RBIMPL_VALUE_NULL),
klass(RBIMPL_VALUE_NULL)
{
}
#endif
};
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_obj_hide(VALUE obj);
VALUE rb_obj_reveal(VALUE obj, VALUE klass); /* do not use this API to change klass information */
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RBASIC_CLASS(VALUE obj)
{
RUBY3_ASSERT_OR_ASSUME(! RB_SPECIAL_CONST_P(obj));
RBIMPL_ASSERT_OR_ASSUME(! RB_SPECIAL_CONST_P(obj));
return RBASIC(obj)->klass;
}
#endif /* RUBY3_RBASIC_H */
#endif /* RBIMPL_RBASIC_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RBIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RBIGNUM_H
#ifndef RBIMPL_RBIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RBIGNUM_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
@ -32,20 +32,20 @@
#define RBIGNUM_NEGATIVE_P RBIGNUM_NEGATIVE_P
/** @endcond */
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
int rb_big_sign(VALUE num);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
static inline bool
RBIGNUM_POSITIVE_P(VALUE b) {
RUBY3_ASSERT_TYPE(b, RUBY_T_BIGNUM);
RBIMPL_ASSERT_TYPE(b, RUBY_T_BIGNUM);
return RBIGNUM_SIGN(b);
}
static inline bool
RBIGNUM_NEGATIVE_P(VALUE b) {
RUBY3_ASSERT_TYPE(b, RUBY_T_BIGNUM);
RBIMPL_ASSERT_TYPE(b, RUBY_T_BIGNUM);
return ! RBIGNUM_POSITIVE_P(b);
}
#endif /* RUBY3_RBIGNUM_H */
#endif /* RBIMPL_RBIGNUM_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RCLASS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RCLASS_H
#ifndef RBIMPL_RCLASS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RCLASS_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
@ -28,7 +28,7 @@
#define RMODULE_IS_REFINEMENT RMODULE_IS_REFINEMENT
#define RMODULE_INCLUDED_INTO_REFINEMENT RMODULE_INCLUDED_INTO_REFINEMENT
#define RCLASS(obj) RUBY3_CAST((struct RClass *)(obj))
#define RCLASS(obj) RBIMPL_CAST((struct RClass *)(obj))
#define RMODULE RCLASS
#define RCLASS_SUPER rb_class_get_superclass
@ -40,8 +40,8 @@ enum ruby_rmodule_flags {
struct RClass; /* Opaque, declared here for RCLASS() macro. */
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_class_get_superclass(VALUE);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_RCLASS_H */
#endif /* RBIMPL_RCLASS_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RDATA_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RDATA_H
#ifndef RBIMPL_RDATA_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RDATA_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
@ -46,18 +46,18 @@
#endif
/** @cond INTERNAL_MACRO */
#define RUBY3_DATA_FUNC(f) RUBY3_CAST((void (*)(void *))(f))
#define RUBY3_ATTRSET_UNTYPED_DATA_FUNC() \
RUBY3_ATTR_WARNING(("untyped Data is unsafe; use TypedData instead")) \
RUBY3_ATTR_DEPRECATED(("by TypedData"))
#define RBIMPL_DATA_FUNC(f) RBIMPL_CAST((void (*)(void *))(f))
#define RBIMPL_ATTRSET_UNTYPED_DATA_FUNC() \
RBIMPL_ATTR_WARNING(("untyped Data is unsafe; use TypedData instead")) \
RBIMPL_ATTR_DEPRECATED(("by TypedData"))
/** @endcond */
#define RDATA(obj) RUBY3_CAST((struct RData *)(obj))
#define RDATA(obj) RBIMPL_CAST((struct RData *)(obj))
#define DATA_PTR(obj) RDATA(obj)->data
#define RUBY_MACRO_SELECT RUBY3_TOKEN_PASTE
#define RUBY_DEFAULT_FREE RUBY3_DATA_FUNC(-1)
#define RUBY_NEVER_FREE RUBY3_DATA_FUNC(0)
#define RUBY_UNTYPED_DATA_FUNC(f) f RUBY3_ATTRSET_UNTYPED_DATA_FUNC()
#define RUBY_MACRO_SELECT RBIMPL_TOKEN_PASTE
#define RUBY_DEFAULT_FREE RBIMPL_DATA_FUNC(-1)
#define RUBY_NEVER_FREE RBIMPL_DATA_FUNC(0)
#define RUBY_UNTYPED_DATA_FUNC(f) f RBIMPL_ATTRSET_UNTYPED_DATA_FUNC()
/*
#define RUBY_DATA_FUNC(func) ((void (*)(void*))(func))
@ -71,26 +71,26 @@ struct RData {
void *data;
};
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_data_object_wrap(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree);
VALUE rb_data_object_zalloc(VALUE klass, size_t size, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#define Data_Wrap_Struct(klass, mark, free, sval) \
rb_data_object_wrap( \
(klass), \
(sval), \
RUBY3_DATA_FUNC(mark), \
RUBY3_DATA_FUNC(free))
RBIMPL_DATA_FUNC(mark), \
RBIMPL_DATA_FUNC(free))
#define Data_Make_Struct0(result, klass, type, size, mark, free, sval) \
VALUE result = rb_data_object_zalloc( \
(klass), \
(size), \
RUBY3_DATA_FUNC(mark), \
RUBY3_DATA_FUNC(free)); \
(sval) = RUBY3_CAST((type *)DATA_PTR(result)); \
RUBY3_CAST(/*suppress unused variable warnings*/(void)(sval))
RBIMPL_DATA_FUNC(mark), \
RBIMPL_DATA_FUNC(free)); \
(sval) = RBIMPL_CAST((type *)DATA_PTR(result)); \
RBIMPL_CAST(/*suppress unused variable warnings*/(void)(sval))
#ifdef HAVE_STMT_AND_DECL_IN_EXPR
#define Data_Make_Struct(klass, type, mark, free, sval) \
@ -109,16 +109,16 @@ RUBY3_SYMBOL_EXPORT_END()
#define Data_Make_Struct(klass, type, mark, free, sval) \
rb_data_object_make( \
(klass), \
RUBY3_DATA_FUNC(mark), \
RUBY3_DATA_FUNC(free), \
RUBY3_CAST((void **)&(sval)), \
RBIMPL_DATA_FUNC(mark), \
RBIMPL_DATA_FUNC(free), \
RBIMPL_CAST((void **)&(sval)), \
sizeof(type))
#endif
#define Data_Get_Struct(obj, type, sval) \
((sval) = RUBY3_CAST((type*)rb_data_object_get(obj)))
((sval) = RBIMPL_CAST((type*)rb_data_object_get(obj)))
RUBY3_ATTRSET_UNTYPED_DATA_FUNC()
RBIMPL_ATTRSET_UNTYPED_DATA_FUNC()
static inline VALUE
rb_data_object_wrap_warning(VALUE klass, void *ptr, RUBY_DATA_FUNC mark, RUBY_DATA_FUNC free)
{
@ -132,7 +132,7 @@ rb_data_object_get(VALUE obj)
return DATA_PTR(obj);
}
RUBY3_ATTRSET_UNTYPED_DATA_FUNC()
RBIMPL_ATTRSET_UNTYPED_DATA_FUNC()
static inline void *
rb_data_object_get_warning(VALUE obj)
{
@ -155,7 +155,7 @@ rb_data_object_make(VALUE klass, RUBY_DATA_FUNC mark_func, RUBY_DATA_FUNC free_f
return result;
}
RUBY3_ATTR_DEPRECATED(("by: rb_data_object_wrap"))
RBIMPL_ATTR_DEPRECATED(("by: rb_data_object_wrap"))
static inline VALUE
rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
{
@ -171,4 +171,4 @@ rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FU
#define rb_data_object_make_0 rb_data_object_make
#define rb_data_object_make_1 rb_data_object_make_warning
#define rb_data_object_make RUBY_MACRO_SELECT(rb_data_object_make_, RUBY_UNTYPED_DATA_WARNING)
#endif /* RUBY3_RDATA_H */
#endif /* RBIMPL_RDATA_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RFILE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RFILE_H
#ifndef RBIMPL_RFILE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RFILE_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
@ -32,5 +32,5 @@ struct RFile {
struct rb_io_t *fptr;
};
#define RFILE(obj) RUBY3_CAST((struct RFile *)(obj))
#endif /* RUBY3_RFILE_H */
#define RFILE(obj) RBIMPL_CAST((struct RFile *)(obj))
#endif /* RBIMPL_RFILE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RHASH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RHASH_H
#ifndef RBIMPL_RHASH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RHASH_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
@ -53,10 +53,10 @@
struct st_table; /* in ruby/st.h */
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
size_t rb_hash_size_num(VALUE hash);
struct st_table *rb_hash_tbl(VALUE, const char *file, int line);
VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_RHASH_H */
#endif /* RBIMPL_RHASH_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RMATCH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RMATCH_H
#ifndef RBIMPL_RMATCH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RMATCH_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
@ -29,7 +29,7 @@
#include "ruby/impl/value_type.h"
#include "ruby/assert.h"
#define RMATCH(obj) RUBY3_CAST((struct RMatch *)(obj))
#define RMATCH(obj) RBIMPL_CAST((struct RMatch *)(obj))
/** @cond INTERNAL_MACRO */
#define RMATCH_REGS RMATCH_REGS
/** @endcond */
@ -59,15 +59,15 @@ struct RMatch {
VALUE regexp; /* RRegexp */
};
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_RETURNS_NONNULL()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_RETURNS_NONNULL()
RBIMPL_ATTR_ARTIFICIAL()
static inline struct re_registers *
RMATCH_REGS(VALUE match)
{
RUBY3_ASSERT_TYPE(match, RUBY_T_MATCH);
RUBY3_ASSERT_OR_ASSUME(RMATCH(match)->rmatch != NULL);
RBIMPL_ASSERT_TYPE(match, RUBY_T_MATCH);
RBIMPL_ASSERT_OR_ASSUME(RMATCH(match)->rmatch != NULL);
return &RMATCH(match)->rmatch->regs;
}
#endif /* RUBY3_RMATCH_H */
#endif /* RBIMPL_RMATCH_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ROBJECT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ROBJECT_H
#ifndef RBIMPL_ROBJECT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ROBJECT_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
@ -33,7 +33,7 @@
#include "ruby/impl/value.h"
#include "ruby/impl/value_type.h"
#define ROBJECT(obj) RUBY3_CAST((struct RObject *)(obj))
#define ROBJECT(obj) RBIMPL_CAST((struct RObject *)(obj))
#define ROBJECT_EMBED_LEN_MAX ROBJECT_EMBED_LEN_MAX
#define ROBJECT_EMBED ROBJECT_EMBED
/** @cond INTERNAL_MACRO */
@ -43,7 +43,7 @@
enum ruby_robject_flags { ROBJECT_EMBED = RUBY_FL_USER1 };
enum ruby_robject_consts { ROBJECT_EMBED_LEN_MAX = RUBY3_EMBED_LEN_MAX_OF(VALUE) };
enum ruby_robject_consts { ROBJECT_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(VALUE) };
struct RObject {
struct RBasic basic;
@ -57,12 +57,12 @@ struct RObject {
} as;
};
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline uint32_t
ROBJECT_NUMIV(VALUE obj)
{
RUBY3_ASSERT_TYPE(obj, RUBY_T_OBJECT);
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
if (RB_FL_ANY_RAW(obj, ROBJECT_EMBED)) {
return ROBJECT_EMBED_LEN_MAX;
@ -72,12 +72,12 @@ ROBJECT_NUMIV(VALUE obj)
}
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE *
ROBJECT_IVPTR(VALUE obj)
{
RUBY3_ASSERT_TYPE(obj, RUBY_T_OBJECT);
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
struct RObject *const ptr = ROBJECT(obj);
@ -94,4 +94,4 @@ ROBJECT_IVPTR(VALUE obj)
RCLASS_IV_INDEX_TBL(rb_obj_class(o)) : \
ROBJECT(o)->as.heap.iv_index_tbl)
#endif /* RUBY3_ROBJECT_H */
#endif /* RBIMPL_ROBJECT_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RREGEXP_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RREGEXP_H
#ifndef RBIMPL_RREGEXP_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RREGEXP_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
@ -28,7 +28,7 @@
#include "ruby/impl/value.h"
#include "ruby/impl/value_type.h"
#define RREGEXP(obj) RUBY3_CAST((struct RRegexp *)(obj))
#define RREGEXP(obj) RBIMPL_CAST((struct RRegexp *)(obj))
#define RREGEXP_PTR(obj) (RREGEXP(obj)->ptr)
/** @cond INTERNAL_MACRO */
#define RREGEXP_SRC RREGEXP_SRC
@ -46,39 +46,39 @@ struct RRegexp {
unsigned long usecnt;
};
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RREGEXP_SRC(VALUE rexp)
{
RUBY3_ASSERT_TYPE(rexp, RUBY_T_REGEXP);
RBIMPL_ASSERT_TYPE(rexp, RUBY_T_REGEXP);
VALUE ret = RREGEXP(rexp)->src;
RUBY3_ASSERT_TYPE(ret, RUBY_T_STRING);
RBIMPL_ASSERT_TYPE(ret, RUBY_T_STRING);
return ret;
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline char *
RREGEXP_SRC_PTR(VALUE rexp)
{
return RSTRING_PTR(RREGEXP_SRC(rexp));
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline long
RREGEXP_SRC_LEN(VALUE rexp)
{
return RSTRING_LEN(RREGEXP_SRC(rexp));
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline char *
RREGEXP_SRC_END(VALUE rexp)
{
return RSTRING_END(RREGEXP_SRC(rexp));
}
#endif /* RUBY3_RREGEXP_H */
#endif /* RBIMPL_RREGEXP_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RSTRING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RSTRING_H
#ifndef RBIMPL_RSTRING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RSTRING_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
@ -32,7 +32,7 @@
#include "ruby/impl/warning_push.h"
#include "ruby/assert.h"
#define RSTRING(obj) RUBY3_CAST((struct RString *)(obj))
#define RSTRING(obj) RBIMPL_CAST((struct RString *)(obj))
#define RSTRING_NOEMBED RSTRING_NOEMBED
#define RSTRING_EMBED_LEN_MASK RSTRING_EMBED_LEN_MASK
#define RSTRING_EMBED_LEN_SHIFT RSTRING_EMBED_LEN_SHIFT
@ -67,7 +67,7 @@ enum ruby_rstring_flags {
enum ruby_rstring_consts {
RSTRING_EMBED_LEN_SHIFT = RUBY_FL_USHIFT + 2,
RSTRING_EMBED_LEN_MAX = RUBY3_EMBED_LEN_MAX_OF(char) - 1
RSTRING_EMBED_LEN_MAX = RBIMPL_EMBED_LEN_MAX_OF(char) - 1
};
struct RString {
@ -85,7 +85,7 @@ struct RString {
} as;
};
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_str_to_str(VALUE);
VALUE rb_string_value(volatile VALUE*);
char *rb_string_value_ptr(volatile VALUE*);
@ -93,36 +93,36 @@ char *rb_string_value_cstr(volatile VALUE*);
VALUE rb_str_export(VALUE);
VALUE rb_str_export_locale(VALUE);
RUBY3_ATTR_ERROR(("rb_check_safe_str() and Check_SafeStr() are obsolete; use StringValue() instead"))
RBIMPL_ATTR_ERROR(("rb_check_safe_str() and Check_SafeStr() are obsolete; use StringValue() instead"))
void rb_check_safe_str(VALUE);
#define Check_SafeStr(v) rb_check_safe_str(RUBY3_CAST((VALUE)(v)))
RUBY3_SYMBOL_EXPORT_END()
#define Check_SafeStr(v) rb_check_safe_str(RBIMPL_CAST((VALUE)(v)))
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline long
RSTRING_EMBED_LEN(VALUE str)
{
RUBY3_ASSERT_TYPE(str, RUBY_T_STRING);
RUBY3_ASSERT_OR_ASSUME(! RB_FL_ANY_RAW(str, RSTRING_NOEMBED));
RBIMPL_ASSERT_TYPE(str, RUBY_T_STRING);
RBIMPL_ASSERT_OR_ASSUME(! RB_FL_ANY_RAW(str, RSTRING_NOEMBED));
VALUE f = RBASIC(str)->flags;
f &= RSTRING_EMBED_LEN_MASK;
f >>= RSTRING_EMBED_LEN_SHIFT;
return RUBY3_CAST((long)f);
return RBIMPL_CAST((long)f);
}
RUBY3_WARNING_PUSH()
#if RUBY3_COMPILER_IS(Intel)
RUBY3_WARNING_IGNORED(413)
RBIMPL_WARNING_PUSH()
#if RBIMPL_COMPILER_IS(Intel)
RBIMPL_WARNING_IGNORED(413)
#endif
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline struct RString
ruby3_rstring_getmem(VALUE str)
{
RUBY3_ASSERT_TYPE(str, RUBY_T_STRING);
RBIMPL_ASSERT_TYPE(str, RUBY_T_STRING);
if (RB_FL_ANY_RAW(str, RSTRING_NOEMBED)) {
return *RSTRING(str);
@ -136,17 +136,17 @@ ruby3_rstring_getmem(VALUE str)
}
}
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline long
RSTRING_LEN(VALUE str)
{
return ruby3_rstring_getmem(str).as.heap.len;
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline char *
RSTRING_PTR(VALUE str)
{
@ -174,7 +174,7 @@ RSTRING_PTR(VALUE str)
return ptr;
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline char *
RSTRING_END(VALUE str)
{
@ -193,7 +193,7 @@ RSTRING_END(VALUE str)
return &buf.as.heap.ptr[buf.as.heap.len];
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline int
RSTRING_LENINT(VALUE str)
{
@ -212,4 +212,4 @@ RSTRING_LENINT(VALUE str)
((ptrvar) = RSTRING_PTR(str), \
(lenvar) = RSTRING_LEN(str))
#endif /* HAVE_STMT_AND_DECL_IN_EXPR */
#endif /* RUBY3_RSTRING_H */
#endif /* RBIMPL_RSTRING_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RSTRUCT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RSTRUCT_H
#ifndef RBIMPL_RSTRUCT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RSTRUCT_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
@ -37,37 +37,37 @@
#define RSTRUCT_GET RSTRUCT_GET
/** @endcond */
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_struct_size(VALUE s);
VALUE rb_struct_aref(VALUE, VALUE);
VALUE rb_struct_aset(VALUE, VALUE, VALUE);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline long
RSTRUCT_LEN(VALUE st)
{
RUBY3_ASSERT_TYPE(st, RUBY_T_STRUCT);
RBIMPL_ASSERT_TYPE(st, RUBY_T_STRUCT);
return RB_NUM2LONG(rb_struct_size(st));
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RSTRUCT_SET(VALUE st, int k, VALUE v)
{
RUBY3_ASSERT_TYPE(st, RUBY_T_STRUCT);
RBIMPL_ASSERT_TYPE(st, RUBY_T_STRUCT);
return rb_struct_aset(st, INT2NUM(k), (v));
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RSTRUCT_GET(VALUE st, int k)
{
RUBY3_ASSERT_TYPE(st, RUBY_T_STRUCT);
RBIMPL_ASSERT_TYPE(st, RUBY_T_STRUCT);
return rb_struct_aref(st, INT2NUM(k));
}
#endif /* RUBY3_RSTRUCT_H */
#endif /* RBIMPL_RSTRUCT_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_RTYPEDDATA_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RTYPEDDATA_H
#ifndef RBIMPL_RTYPEDDATA_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_RTYPEDDATA_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
@ -43,10 +43,10 @@
#define HAVE_RB_DATA_TYPE_T_PARENT 1
#define RUBY_TYPED_DEFAULT_FREE RUBY_DEFAULT_FREE
#define RUBY_TYPED_NEVER_FREE RUBY_NEVER_FREE
#define RTYPEDDATA(obj) RUBY3_CAST((struct RTypedData *)(obj))
#define RTYPEDDATA(obj) RBIMPL_CAST((struct RTypedData *)(obj))
#define RTYPEDDATA_DATA(v) (RTYPEDDATA(v)->data)
#define Check_TypedStruct(v, t) \
rb_check_typeddata(RUBY3_CAST((VALUE)(v)), (t))
rb_check_typeddata(RBIMPL_CAST((VALUE)(v)), (t))
/** @cond INTERNAL_MACRO */
#define RTYPEDDATA_P RTYPEDDATA_P
@ -88,21 +88,21 @@ struct RTypedData {
void *data;
};
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *);
VALUE rb_data_typed_object_zalloc(VALUE klass, size_t size, const rb_data_type_t *type);
int rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent);
int rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type);
void *rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#define TypedData_Wrap_Struct(klass,data_type,sval)\
rb_data_typed_object_wrap((klass),(sval),(data_type))
#define TypedData_Make_Struct0(result, klass, type, size, data_type, sval) \
VALUE result = rb_data_typed_object_zalloc(klass, size, data_type); \
(sval) = RUBY3_CAST((type *)RTYPEDDATA_DATA(result)); \
RUBY3_CAST(/*suppress unused variable warnings*/(void)(sval))
(sval) = RBIMPL_CAST((type *)RTYPEDDATA_DATA(result)); \
RBIMPL_CAST(/*suppress unused variable warnings*/(void)(sval))
#ifdef HAVE_STMT_AND_DECL_IN_EXPR
#define TypedData_Make_Struct(klass, type, data_type, sval) \
@ -121,38 +121,38 @@ RUBY3_SYMBOL_EXPORT_END()
rb_data_typed_object_make( \
(klass), \
(data_type), \
RUBY3_CAST((void **)&(sval)), \
RBIMPL_CAST((void **)&(sval)), \
sizeof(type))
#endif
#define TypedData_Get_Struct(obj,type,data_type,sval) \
((sval) = RUBY3_CAST((type *)rb_check_typeddata((obj), (data_type))))
((sval) = RBIMPL_CAST((type *)rb_check_typeddata((obj), (data_type))))
RUBY3_ATTR_PURE()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
ruby3_rtypeddata_p(VALUE obj)
{
return RTYPEDDATA(obj)->typed_flag == 1;
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RTYPEDDATA_P(VALUE obj)
{
#if ! RUBY_NDEBUG
if (RB_UNLIKELY(! RB_TYPE_P(obj, RUBY_T_DATA))) {
Check_Type(obj, RUBY_T_DATA);
RUBY3_UNREACHABLE_RETURN(false);
RBIMPL_UNREACHABLE_RETURN(false);
}
#endif
return ruby3_rtypeddata_p(obj);
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
/* :TODO: can this function be __attribute__((returns_nonnull)) or not? */
static inline const struct rb_data_type_struct *
RTYPEDDATA_TYPE(VALUE obj)
@ -160,7 +160,7 @@ RTYPEDDATA_TYPE(VALUE obj)
#if ! RUBY_NDEBUG
if (RB_UNLIKELY(! RTYPEDDATA_P(obj))) {
rb_unexpected_type(obj, RUBY_T_DATA);
RUBY3_UNREACHABLE_RETURN(NULL);
RBIMPL_UNREACHABLE_RETURN(NULL);
}
#endif
@ -174,11 +174,11 @@ rb_data_typed_object_make(VALUE klass, const rb_data_type_t *type, void **datap,
return result;
}
RUBY3_ATTR_DEPRECATED(("by: rb_data_typed_object_wrap"))
RBIMPL_ATTR_DEPRECATED(("by: rb_data_typed_object_wrap"))
static inline VALUE
rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type)
{
return rb_data_typed_object_wrap(klass, datap, type);
}
#endif /* RUBY3_RTYPEDDATA_H */
#endif /* RBIMPL_RTYPEDDATA_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_CTYPE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CTYPE_H
#ifndef RBIMPL_CTYPE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_CTYPE_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
@ -53,151 +53,151 @@
#define STRNCASECMP st_locale_insensitive_strncasecmp
#define STRTOUL ruby_strtoul
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
/* locale insensitive functions */
int st_locale_insensitive_strcasecmp(const char *s1, const char *s2);
int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n);
unsigned long ruby_strtoul(const char *str, char **endptr, int base);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
/*
* We are making the functions below to return `int` instead of `bool`. They
* have been as such since their birth at 5f237d79033b2109afb768bc889611fa9630.
*/
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isascii(int c)
{
return '\0' <= c && c <= '\x7f';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isupper(int c)
{
return 'A' <= c && c <= 'Z';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_islower(int c)
{
return 'a' <= c && c <= 'z';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isalpha(int c)
{
return rb_isupper(c) || rb_islower(c);
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isdigit(int c)
{
return '0' <= c && c <= '9';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isalnum(int c)
{
return rb_isalpha(c) || rb_isdigit(c);
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isxdigit(int c)
{
return rb_isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isblank(int c)
{
return c == ' ' || c == '\t';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isspace(int c)
{
return c == ' ' || ('\t' <= c && c <= '\r');
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_iscntrl(int c)
{
return ('\0' <= c && c < ' ') || c == '\x7f';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isprint(int c)
{
return ' ' <= c && c <= '\x7e';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_ispunct(int c)
{
return !rb_isalnum(c);
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_isgraph(int c)
{
return '!' <= c && c <= '\x7e';
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_tolower(int c)
{
return rb_isupper(c) ? (c|0x20) : c;
}
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_CONST()
RBIMPL_ATTR_CONSTEXPR(CXX11)
RBIMPL_ATTR_ARTIFICIAL()
static inline int
rb_toupper(int c)
{
return rb_islower(c) ? (c&0x5f) : c;
}
#endif /* RUBY3_CTYPE_H */
#endif /* RBIMPL_CTYPE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_DLLEXPORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_DLLEXPORT_H
#ifndef RBIMPL_DLLEXPORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_DLLEXPORT_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
@ -53,7 +53,7 @@
#if ! defined(MJIT_HEADER)
# define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED
#elif ! RUBY3_COMPILER_IS(MSVC)
#elif ! RBIMPL_COMPILER_IS(MSVC)
# define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED
#else
# define MJIT_FUNC_EXPORTED static
@ -74,19 +74,19 @@
/** Shortcut macro equivalent to `RUBY_SYMBOL_EXPORT_BEGIN extern "C" {`.
* \@shyouhei finds it handy. */
#if defined(__DOXYGEN__)
# define RUBY3_SYMBOL_EXPORT_BEGIN() /* void */
# define RBIMPL_SYMBOL_EXPORT_BEGIN() /* void */
#elif defined(__cplusplus)
# define RUBY3_SYMBOL_EXPORT_BEGIN() RUBY_SYMBOL_EXPORT_BEGIN extern "C" {
# define RBIMPL_SYMBOL_EXPORT_BEGIN() RUBY_SYMBOL_EXPORT_BEGIN extern "C" {
#else
# define RUBY3_SYMBOL_EXPORT_BEGIN() RUBY_SYMBOL_EXPORT_BEGIN
# define RBIMPL_SYMBOL_EXPORT_BEGIN() RUBY_SYMBOL_EXPORT_BEGIN
#endif
/** Counterpart of #RUBY3_SYMBOL_EXPORT_BEGIN */
/** Counterpart of #RBIMPL_SYMBOL_EXPORT_BEGIN */
#if defined(__DOXYGEN__)
# define RUBY3_SYMBOL_EXPORT_END() /* void */
# define RBIMPL_SYMBOL_EXPORT_END() /* void */
#elif defined(__cplusplus)
# define RUBY3_SYMBOL_EXPORT_END() } RUBY_SYMBOL_EXPORT_END
# define RBIMPL_SYMBOL_EXPORT_END() } RUBY_SYMBOL_EXPORT_END
#else
# define RUBY3_SYMBOL_EXPORT_END() RUBY_SYMBOL_EXPORT_END
# define RBIMPL_SYMBOL_EXPORT_END() RUBY_SYMBOL_EXPORT_END
#endif
#endif /* RUBY3_DLLEXPORT_H */
#endif /* RBIMPL_DLLEXPORT_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_DOSISH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_DOSISH_H
#ifndef RBIMPL_DOSISH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_DOSISH_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
@ -60,4 +60,4 @@
# endif
#endif
#endif /* RUBY3_DOSISH_H */
#endif /* RBIMPL_DOSISH_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ERROR_H
#ifndef RBIMPL_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_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
@ -24,7 +24,7 @@
#include "ruby/impl/value.h"
#include "ruby/backward/2/attributes.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_errinfo(void);
void rb_set_errinfo(VALUE);
@ -69,6 +69,6 @@ PRINTF_ARGS(void rb_sys_warning(const char*, ...), 1, 2);
COLDFUNC PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2);
PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_ERROR_H */
#endif /* RBIMPL_ERROR_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_EVAL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_EVAL_H
#ifndef RBIMPL_EVAL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_EVAL_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
@ -23,7 +23,7 @@
#include "ruby/impl/dllexport.h"
#include "ruby/impl/value.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
VALUE rb_eval_string(const char*);
VALUE rb_eval_string_protect(const char*, int*);
@ -45,6 +45,6 @@ VALUE rb_current_receiver(void);
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *);
VALUE rb_extract_keywords(VALUE *orighash);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_EVAL_H */
#endif /* RBIMPL_EVAL_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_EVENT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_EVENT_H
#ifndef RBIMPL_EVENT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_EVENT_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
@ -23,7 +23,7 @@
#include "ruby/impl/dllexport.h"
#include "ruby/impl/value.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
/* traditional set_trace_func events */
#define RUBY_EVENT_NONE 0x0000
@ -70,6 +70,6 @@ typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE s
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
int rb_remove_event_hook(rb_event_hook_func_t func);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_EVENT_H */
#endif /* RBIMPL_EVENT_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_FL_TYPE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_FL_TYPE_H
#ifndef RBIMPL_FL_TYPE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_FL_TYPE_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
@ -38,47 +38,47 @@
/** @cond INTERNAL_MACRO */
#ifdef ENUM_OVER_INT
# define RUBY3_WIDER_ENUM 1
# define RBIMPL_WIDER_ENUM 1
#elif SIZEOF_INT * CHAR_BIT > 12+19+1
# define RUBY3_WIDER_ENUM 1
# define RBIMPL_WIDER_ENUM 1
#else
# define RUBY3_WIDER_ENUM 0
# define RBIMPL_WIDER_ENUM 0
#endif
/** @endcond */
#define FL_SINGLETON RUBY3_CAST((VALUE)RUBY_FL_SINGLETON)
#define FL_WB_PROTECTED RUBY3_CAST((VALUE)RUBY_FL_WB_PROTECTED)
#define FL_PROMOTED0 RUBY3_CAST((VALUE)RUBY_FL_PROMOTED0)
#define FL_PROMOTED1 RUBY3_CAST((VALUE)RUBY_FL_PROMOTED1)
#define FL_FINALIZE RUBY3_CAST((VALUE)RUBY_FL_FINALIZE)
#define FL_TAINT RUBY3_CAST((VALUE)RUBY_FL_TAINT)
#define FL_UNTRUSTED RUBY3_CAST((VALUE)RUBY_FL_UNTRUSTED)
#define FL_SEEN_OBJ_ID RUBY3_CAST((VALUE)RUBY_FL_SEEN_OBJ_ID)
#define FL_EXIVAR RUBY3_CAST((VALUE)RUBY_FL_EXIVAR)
#define FL_FREEZE RUBY3_CAST((VALUE)RUBY_FL_FREEZE)
#define FL_SINGLETON RBIMPL_CAST((VALUE)RUBY_FL_SINGLETON)
#define FL_WB_PROTECTED RBIMPL_CAST((VALUE)RUBY_FL_WB_PROTECTED)
#define FL_PROMOTED0 RBIMPL_CAST((VALUE)RUBY_FL_PROMOTED0)
#define FL_PROMOTED1 RBIMPL_CAST((VALUE)RUBY_FL_PROMOTED1)
#define FL_FINALIZE RBIMPL_CAST((VALUE)RUBY_FL_FINALIZE)
#define FL_TAINT RBIMPL_CAST((VALUE)RUBY_FL_TAINT)
#define FL_UNTRUSTED RBIMPL_CAST((VALUE)RUBY_FL_UNTRUSTED)
#define FL_SEEN_OBJ_ID RBIMPL_CAST((VALUE)RUBY_FL_SEEN_OBJ_ID)
#define FL_EXIVAR RBIMPL_CAST((VALUE)RUBY_FL_EXIVAR)
#define FL_FREEZE RBIMPL_CAST((VALUE)RUBY_FL_FREEZE)
#define FL_USHIFT RUBY3_CAST((VALUE)RUBY_FL_USHIFT)
#define FL_USHIFT RBIMPL_CAST((VALUE)RUBY_FL_USHIFT)
#define FL_USER0 RUBY3_CAST((VALUE)RUBY_FL_USER0)
#define FL_USER1 RUBY3_CAST((VALUE)RUBY_FL_USER1)
#define FL_USER2 RUBY3_CAST((VALUE)RUBY_FL_USER2)
#define FL_USER3 RUBY3_CAST((VALUE)RUBY_FL_USER3)
#define FL_USER4 RUBY3_CAST((VALUE)RUBY_FL_USER4)
#define FL_USER5 RUBY3_CAST((VALUE)RUBY_FL_USER5)
#define FL_USER6 RUBY3_CAST((VALUE)RUBY_FL_USER6)
#define FL_USER7 RUBY3_CAST((VALUE)RUBY_FL_USER7)
#define FL_USER8 RUBY3_CAST((VALUE)RUBY_FL_USER8)
#define FL_USER9 RUBY3_CAST((VALUE)RUBY_FL_USER9)
#define FL_USER10 RUBY3_CAST((VALUE)RUBY_FL_USER10)
#define FL_USER11 RUBY3_CAST((VALUE)RUBY_FL_USER11)
#define FL_USER12 RUBY3_CAST((VALUE)RUBY_FL_USER12)
#define FL_USER13 RUBY3_CAST((VALUE)RUBY_FL_USER13)
#define FL_USER14 RUBY3_CAST((VALUE)RUBY_FL_USER14)
#define FL_USER15 RUBY3_CAST((VALUE)RUBY_FL_USER15)
#define FL_USER16 RUBY3_CAST((VALUE)RUBY_FL_USER16)
#define FL_USER17 RUBY3_CAST((VALUE)RUBY_FL_USER17)
#define FL_USER18 RUBY3_CAST((VALUE)RUBY_FL_USER18)
#define FL_USER19 RUBY3_CAST((VALUE)(unsigned int)RUBY_FL_USER19)
#define FL_USER0 RBIMPL_CAST((VALUE)RUBY_FL_USER0)
#define FL_USER1 RBIMPL_CAST((VALUE)RUBY_FL_USER1)
#define FL_USER2 RBIMPL_CAST((VALUE)RUBY_FL_USER2)
#define FL_USER3 RBIMPL_CAST((VALUE)RUBY_FL_USER3)
#define FL_USER4 RBIMPL_CAST((VALUE)RUBY_FL_USER4)
#define FL_USER5 RBIMPL_CAST((VALUE)RUBY_FL_USER5)
#define FL_USER6 RBIMPL_CAST((VALUE)RUBY_FL_USER6)
#define FL_USER7 RBIMPL_CAST((VALUE)RUBY_FL_USER7)
#define FL_USER8 RBIMPL_CAST((VALUE)RUBY_FL_USER8)
#define FL_USER9 RBIMPL_CAST((VALUE)RUBY_FL_USER9)
#define FL_USER10 RBIMPL_CAST((VALUE)RUBY_FL_USER10)
#define FL_USER11 RBIMPL_CAST((VALUE)RUBY_FL_USER11)
#define FL_USER12 RBIMPL_CAST((VALUE)RUBY_FL_USER12)
#define FL_USER13 RBIMPL_CAST((VALUE)RUBY_FL_USER13)
#define FL_USER14 RBIMPL_CAST((VALUE)RUBY_FL_USER14)
#define FL_USER15 RBIMPL_CAST((VALUE)RUBY_FL_USER15)
#define FL_USER16 RBIMPL_CAST((VALUE)RUBY_FL_USER16)
#define FL_USER17 RBIMPL_CAST((VALUE)RUBY_FL_USER17)
#define FL_USER18 RBIMPL_CAST((VALUE)RUBY_FL_USER18)
#define FL_USER19 RBIMPL_CAST((VALUE)(unsigned int)RUBY_FL_USER19)
#define ELTS_SHARED RUBY_ELTS_SHARED
#define RUBY_ELTS_SHARED RUBY_ELTS_SHARED
@ -157,7 +157,7 @@ enum ruby_fl_ushift { RUBY_FL_USHIFT = 12 };
* that we do not support 16 bit `int` environment. */
RB_GNUC_EXTENSION
enum
RUBY3_ATTR_FLAG_ENUM()
RBIMPL_ATTR_FLAG_ENUM()
ruby_fl_type {
RUBY_FL_WB_PROTECTED = (1<<5),
RUBY_FL_PROMOTED0 = (1<<5),
@ -170,33 +170,33 @@ ruby_fl_type {
RUBY_FL_EXIVAR = (1<<10),
RUBY_FL_FREEZE = (1<<11),
#define RUBY3_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
RUBY3_FL_USER_N(0),
RUBY3_FL_USER_N(1),
RUBY3_FL_USER_N(2),
RUBY3_FL_USER_N(3),
RUBY3_FL_USER_N(4),
RUBY3_FL_USER_N(5),
RUBY3_FL_USER_N(6),
RUBY3_FL_USER_N(7),
RUBY3_FL_USER_N(8),
RUBY3_FL_USER_N(9),
RUBY3_FL_USER_N(10),
RUBY3_FL_USER_N(11),
RUBY3_FL_USER_N(12),
RUBY3_FL_USER_N(13),
RUBY3_FL_USER_N(14),
RUBY3_FL_USER_N(15),
RUBY3_FL_USER_N(16),
RUBY3_FL_USER_N(17),
RUBY3_FL_USER_N(18),
#define RBIMPL_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
RBIMPL_FL_USER_N(0),
RBIMPL_FL_USER_N(1),
RBIMPL_FL_USER_N(2),
RBIMPL_FL_USER_N(3),
RBIMPL_FL_USER_N(4),
RBIMPL_FL_USER_N(5),
RBIMPL_FL_USER_N(6),
RBIMPL_FL_USER_N(7),
RBIMPL_FL_USER_N(8),
RBIMPL_FL_USER_N(9),
RBIMPL_FL_USER_N(10),
RBIMPL_FL_USER_N(11),
RBIMPL_FL_USER_N(12),
RBIMPL_FL_USER_N(13),
RBIMPL_FL_USER_N(14),
RBIMPL_FL_USER_N(15),
RBIMPL_FL_USER_N(16),
RBIMPL_FL_USER_N(17),
RBIMPL_FL_USER_N(18),
#if ENUM_OVER_INT
RUBY3_FL_USER_N(19),
RBIMPL_FL_USER_N(19),
#else
# define RUBY_FL_USER19 (RUBY3_VALUE_ONE<<(RUBY_FL_USHIFT+19))
# define RUBY_FL_USER19 (RBIMPL_VALUE_ONE<<(RUBY_FL_USHIFT+19))
#endif
#undef RUBY3_FL_USER_N
#undef RUBY3_WIDER_ENUM
#undef RBIMPL_FL_USER_N
#undef RBIMPL_WIDER_ENUM
RUBY_ELTS_SHARED = RUBY_FL_USER2,
RUBY_FL_SINGLETON = RUBY_FL_USER0,
@ -204,14 +204,14 @@ ruby_fl_type {
enum { RUBY_FL_DUPPED = RUBY_T_MASK | RUBY_FL_EXIVAR | RUBY_FL_TAINT };
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
void rb_obj_infect(VALUE victim, VALUE carrier);
void rb_freeze_singleton_class(VALUE klass);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RUBY3_ATTR_FORCEINLINE()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_FORCEINLINE()
static bool
RB_FL_ABLE(VALUE obj)
{
@ -226,17 +226,17 @@ RB_FL_ABLE(VALUE obj)
}
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RB_FL_TEST_RAW(VALUE obj, VALUE flags)
{
RUBY3_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
return RBASIC(obj)->flags & flags;
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RB_FL_TEST(VALUE obj, VALUE flags)
{
@ -244,59 +244,59 @@ RB_FL_TEST(VALUE obj, VALUE flags)
return RB_FL_TEST_RAW(obj, flags);
}
else {
return RUBY3_VALUE_NULL;
return RBIMPL_VALUE_NULL;
}
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_FL_ANY_RAW(VALUE obj, VALUE flags)
{
return RB_FL_TEST_RAW(obj, flags);
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_FL_ANY(VALUE obj, VALUE flags)
{
return RB_FL_TEST(obj, flags);
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_FL_ALL_RAW(VALUE obj, VALUE flags)
{
return RB_FL_TEST_RAW(obj, flags) == flags;
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_FL_ALL(VALUE obj, VALUE flags)
{
return RB_FL_TEST(obj, flags) == flags;
}
RUBY3_ATTR_NOALIAS()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
ruby3_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
{
obj->flags |= flags;
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_FL_SET_RAW(VALUE obj, VALUE flags)
{
RUBY3_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
ruby3_fl_set_raw_raw(RBASIC(obj), flags);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_FL_SET(VALUE obj, VALUE flags)
{
@ -305,23 +305,23 @@ RB_FL_SET(VALUE obj, VALUE flags)
}
}
RUBY3_ATTR_NOALIAS()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
ruby3_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
{
obj->flags &= ~flags;
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_FL_UNSET_RAW(VALUE obj, VALUE flags)
{
RUBY3_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
ruby3_fl_unset_raw_raw(RBASIC(obj), flags);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_FL_UNSET(VALUE obj, VALUE flags)
{
@ -330,23 +330,23 @@ RB_FL_UNSET(VALUE obj, VALUE flags)
}
}
RUBY3_ATTR_NOALIAS()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NOALIAS()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
ruby3_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
{
obj->flags ^= flags;
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_FL_REVERSE_RAW(VALUE obj, VALUE flags)
{
RUBY3_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
ruby3_fl_reverse_raw_raw(RBASIC(obj), flags);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_FL_REVERSE(VALUE obj, VALUE flags)
{
@ -355,8 +355,8 @@ RB_FL_REVERSE(VALUE obj, VALUE flags)
}
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_OBJ_TAINTABLE(VALUE obj)
{
@ -374,30 +374,30 @@ RB_OBJ_TAINTABLE(VALUE obj)
}
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RB_OBJ_TAINTED_RAW(VALUE obj)
{
return RB_FL_TEST_RAW(obj, RUBY_FL_TAINT);
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_OBJ_TAINTED(VALUE obj)
{
return RB_FL_ANY(obj, RUBY_FL_TAINT);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_OBJ_TAINT_RAW(VALUE obj)
{
RB_FL_SET_RAW(obj, RUBY_FL_TAINT);
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_OBJ_TAINT(VALUE obj)
{
@ -406,16 +406,16 @@ RB_OBJ_TAINT(VALUE obj)
}
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
{
RUBY3_ASSERT_OR_ASSUME(RB_OBJ_TAINTABLE(dst));
RUBY3_ASSERT_OR_ASSUME(RB_FL_ABLE(src));
RBIMPL_ASSERT_OR_ASSUME(RB_OBJ_TAINTABLE(dst));
RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(src));
RB_FL_SET_RAW(dst, RB_OBJ_TAINTED_RAW(src));
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_OBJ_INFECT(VALUE dst, VALUE src)
{
@ -424,8 +424,8 @@ RB_OBJ_INFECT(VALUE dst, VALUE src)
}
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
/* It is intentional not to return bool here. There is a place in ruby core
* (namely class.c:singleton_class_of()) where return value of this function is
* verbatimly passed to RB_FL_SET_RAW. */
@ -435,8 +435,8 @@ RB_OBJ_FROZEN_RAW(VALUE obj)
return RB_FL_TEST_RAW(obj, RUBY_FL_FREEZE);
}
RUBY3_ATTR_PURE_ON_NDEBUG()
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_PURE_ON_NDEBUG()
RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_OBJ_FROZEN(VALUE obj)
{
@ -448,7 +448,7 @@ RB_OBJ_FROZEN(VALUE obj)
}
}
RUBY3_ATTR_ARTIFICIAL()
RBIMPL_ATTR_ARTIFICIAL()
static inline void
RB_OBJ_FREEZE_RAW(VALUE obj)
{
@ -466,4 +466,4 @@ rb_obj_freeze_inline(VALUE x)
}
}
#endif /* RUBY3_FL_TYPE_H */
#endif /* RBIMPL_FL_TYPE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_GC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_GC_H
#ifndef RBIMPL_GC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_GC_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
@ -23,13 +23,13 @@
#include "ruby/impl/dllexport.h"
#include "ruby/impl/value.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
void rb_global_variable(VALUE*);
void rb_gc_register_mark_object(VALUE);
void rb_gc_register_address(VALUE*);
void rb_gc_unregister_address(VALUE*);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_GC_H */
#endif /* RBIMPL_GC_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_GLOB_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_GLOB_H
#ifndef RBIMPL_GLOB_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_GLOB_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
@ -23,13 +23,13 @@
#include "ruby/impl/dllexport.h"
#include "ruby/impl/value.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
typedef int ruby_glob_func(const char*,VALUE, void*);
void rb_glob(const char*,void(*)(const char*,VALUE,void*),VALUE);
int ruby_glob(const char*,int,ruby_glob_func*,VALUE);
int ruby_brace_glob(const char*,int,ruby_glob_func*,VALUE);
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_GLOB_H */
#endif /* RBIMPL_GLOB_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_GLOBALS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_GLOBALS_H
#ifndef RBIMPL_GLOBALS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_GLOBALS_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
@ -27,7 +27,7 @@
#include "ruby/impl/value.h"
#include "ruby/impl/value_type.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()
#define RUBY_INTEGER_UNIFICATION 1
@ -119,7 +119,7 @@ RUBY_EXTERN VALUE rb_eMathDomainError;
RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
RUBY3_ATTR_PURE()
RBIMPL_ATTR_PURE()
static inline VALUE
rb_class_of(VALUE obj)
{
@ -146,7 +146,7 @@ rb_class_of(VALUE obj)
}
#if RUBY_NDEBUG
RUBY3_UNREACHABLE_RETURN(Qfalse);
RBIMPL_UNREACHABLE_RETURN(Qfalse);
#else
RUBY_ASSERT_FAIL(rb_class_of);
#endif
@ -154,6 +154,6 @@ rb_class_of(VALUE obj)
#define CLASS_OF rb_class_of
RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()
#endif /* RUBY3_GLOBALS_H */
#endif /* RBIMPL_GLOBALS_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_HAS_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_ATTRIBUTE_H
#ifndef RBIMPL_HAS_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_HAS_ATTRIBUTE_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,147 +18,147 @@
* 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_HAS_ATTRIBUTE.
* @brief Defines #RBIMPL_HAS_ATTRIBUTE.
*/
#include "ruby/impl/config.h"
#include "ruby/impl/compiler_since.h"
#include "ruby/impl/token_paste.h"
#if defined(__has_attribute)
# if __has_attribute(pure) || RUBY3_COMPILER_IS(GCC)
# if __has_attribute(pure) || RBIMPL_COMPILER_IS(GCC)
# /* FreeBSD's <sys/cdefs.h> defines its own *broken* version of
# * __has_attribute. Cygwin copied that content to be a victim of the
# * broken-ness. We don't take them into account. */
# define RUBY3_HAVE___HAS_ATTRIBUTE 1
# define RBIMPL_HAVE___HAS_ATTRIBUTE 1
# endif
#endif
/** Wraps (or simulates) `__has_attribute`. */
#if defined(RUBY3_HAVE___HAS_ATTRIBUTE)
# define RUBY3_HAS_ATTRIBUTE(_) __has_attribute(_)
#if defined(RBIMPL_HAVE___HAS_ATTRIBUTE)
# define RBIMPL_HAS_ATTRIBUTE(_) __has_attribute(_)
#elif RUBY3_COMPILER_IS(GCC)
#elif RBIMPL_COMPILER_IS(GCC)
# /* GCC <= 4 lack __has_attribute predefined macro, while have attributes
# * themselves. We can simulate the macro like the following: */
# define RUBY3_HAS_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_ATTRIBUTE_, _)
# define RUBY3_HAS_ATTRIBUTE_aligned RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_alloc_size RUBY3_COMPILER_SINCE(GCC, 4, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_artificial RUBY3_COMPILER_SINCE(GCC, 4, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_always_inline RUBY3_COMPILER_SINCE(GCC, 3, 1, 0)
# define RUBY3_HAS_ATTRIBUTE_cdecl RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_cold RUBY3_COMPILER_SINCE(GCC, 4, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_const RUBY3_COMPILER_SINCE(GCC, 2, 6, 0)
# define RUBY3_HAS_ATTRIBUTE_deprecated RUBY3_COMPILER_SINCE(GCC, 3, 1, 0)
# define RUBY3_HAS_ATTRIBUTE_dllexport RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_dllimport RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_error RUBY3_COMPILER_SINCE(GCC, 4, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_format RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_hot RUBY3_COMPILER_SINCE(GCC, 4, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_leaf RUBY3_COMPILER_SINCE(GCC, 4, 6, 0)
# define RUBY3_HAS_ATTRIBUTE_malloc RUBY3_COMPILER_SINCE(GCC, 3, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_no_address_safety_analysis RUBY3_COMPILER_SINCE(GCC, 4, 8, 0)
# define RUBY3_HAS_ATTRIBUTE_no_sanitize_address RUBY3_COMPILER_SINCE(GCC, 4, 8, 0)
# define RUBY3_HAS_ATTRIBUTE_no_sanitize_undefined RUBY3_COMPILER_SINCE(GCC, 4, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_noinline RUBY3_COMPILER_SINCE(GCC, 3, 1, 0)
# define RUBY3_HAS_ATTRIBUTE_nonnull RUBY3_COMPILER_SINCE(GCC, 3, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_noreturn RUBY3_COMPILER_SINCE(GCC, 2, 5, 0)
# define RUBY3_HAS_ATTRIBUTE_nothrow RUBY3_COMPILER_SINCE(GCC, 3, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_pure RUBY3_COMPILER_SINCE(GCC, 2,96, 0)
# define RUBY3_HAS_ATTRIBUTE_returns_nonnull RUBY3_COMPILER_SINCE(GCC, 4, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_returns_twice RUBY3_COMPILER_SINCE(GCC, 4, 1, 0)
# define RUBY3_HAS_ATTRIBUTE_stdcall RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_unused RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_ATTRIBUTE_visibility RUBY3_COMPILER_SINCE(GCC, 3, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_warn_unused_result RUBY3_COMPILER_SINCE(GCC, 3, 4, 0)
# define RUBY3_HAS_ATTRIBUTE_warning RUBY3_COMPILER_SINCE(GCC, 4, 3, 0)
# define RUBY3_HAS_ATTRIBUTE_weak RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_ATTRIBUTE_, _)
# define RBIMPL_HAS_ATTRIBUTE_aligned RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_alloc_size RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_artificial RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_always_inline RBIMPL_COMPILER_SINCE(GCC, 3, 1, 0)
# define RBIMPL_HAS_ATTRIBUTE_cdecl RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_cold RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_const RBIMPL_COMPILER_SINCE(GCC, 2, 6, 0)
# define RBIMPL_HAS_ATTRIBUTE_deprecated RBIMPL_COMPILER_SINCE(GCC, 3, 1, 0)
# define RBIMPL_HAS_ATTRIBUTE_dllexport RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_dllimport RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_error RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_format RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_hot RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_leaf RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
# define RBIMPL_HAS_ATTRIBUTE_malloc RBIMPL_COMPILER_SINCE(GCC, 3, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_no_address_safety_analysis RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize_address RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize_undefined RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_noinline RBIMPL_COMPILER_SINCE(GCC, 3, 1, 0)
# define RBIMPL_HAS_ATTRIBUTE_nonnull RBIMPL_COMPILER_SINCE(GCC, 3, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_noreturn RBIMPL_COMPILER_SINCE(GCC, 2, 5, 0)
# define RBIMPL_HAS_ATTRIBUTE_nothrow RBIMPL_COMPILER_SINCE(GCC, 3, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_pure RBIMPL_COMPILER_SINCE(GCC, 2,96, 0)
# define RBIMPL_HAS_ATTRIBUTE_returns_nonnull RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_returns_twice RBIMPL_COMPILER_SINCE(GCC, 4, 1, 0)
# define RBIMPL_HAS_ATTRIBUTE_stdcall RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_unused RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_ATTRIBUTE_visibility RBIMPL_COMPILER_SINCE(GCC, 3, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_warn_unused_result RBIMPL_COMPILER_SINCE(GCC, 3, 4, 0)
# define RBIMPL_HAS_ATTRIBUTE_warning RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
# define RBIMPL_HAS_ATTRIBUTE_weak RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# /* Note that "0, 0, 0" might be inaccurate. */
#elif RUBY3_COMPILER_IS(SunPro)
#elif RBIMPL_COMPILER_IS(SunPro)
# /* Oracle Solaris Studio 12.4 (cc version 5.11) introduced __has_attribute.
# * Before that, following attributes were available. */
# /* See https://docs.oracle.com/cd/F24633_01/index.html */
# define RUBY3_HAS_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_ATTRIBUTE_, _)
# define RUBY3_HAS_ATTRIBUTE_alias RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_aligned RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_always_inline RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_HAS_ATTRIBUTE_const RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_constructor RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_destructor RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_malloc RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_noinline RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_noreturn RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_packed RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_pure RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_returns_twice RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_HAS_ATTRIBUTE_vector_size RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_HAS_ATTRIBUTE_visibility RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RUBY3_HAS_ATTRIBUTE_weak RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_ATTRIBUTE_, _)
# define RBIMPL_HAS_ATTRIBUTE_alias RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_aligned RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_always_inline RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RBIMPL_HAS_ATTRIBUTE_const RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_constructor RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_destructor RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_malloc RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_noinline RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_noreturn RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_packed RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_pure RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_returns_twice RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RBIMPL_HAS_ATTRIBUTE_vector_size RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RBIMPL_HAS_ATTRIBUTE_visibility RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
# define RBIMPL_HAS_ATTRIBUTE_weak RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
#elif defined (_MSC_VER)
# define RUBY3_HAS_ATTRIBUTE(_) 0
# define RBIMPL_HAS_ATTRIBUTE(_) 0
# /* Fallback below doesn't work: see win32/Makefile.sub */
#else
# /* Take config.h definition when available. */
# define RUBY3_HAS_ATTRIBUTE(_) (RUBY3_TOKEN_PASTE(RUBY3_HAS_ATTRIBUTE_, _)+0)
# define RBIMPL_HAS_ATTRIBUTE(_) (RBIMPL_TOKEN_PASTE(RBIMPL_HAS_ATTRIBUTE_, _)+0)
# ifdef ALWAYS_INLINE
# define RUBY3_HAS_ATTRIBUTE_always_inline 1
# define RBIMPL_HAS_ATTRIBUTE_always_inline 1
# endif
# ifdef FUNC_CDECL
# define RUBY3_HAS_ATTRIBUTE_cdecl 1
# define RBIMPL_HAS_ATTRIBUTE_cdecl 1
# endif
# ifdef CONSTFUNC
# define RUBY3_HAS_ATTRIBUTE_const 1
# define RBIMPL_HAS_ATTRIBUTE_const 1
# endif
# ifdef DEPRECATED
# define RUBY3_HAS_ATTRIBUTE_deprecated 1
# define RBIMPL_HAS_ATTRIBUTE_deprecated 1
# endif
# ifdef ERRORFUNC
# define RUBY3_HAS_ATTRIBUTE_error 1
# define RBIMPL_HAS_ATTRIBUTE_error 1
# endif
# ifdef FUNC_FASTCALL
# define RUBY3_HAS_ATTRIBUTE_fastcall 1
# define RBIMPL_HAS_ATTRIBUTE_fastcall 1
# endif
# ifdef PUREFUNC
# define RUBY3_HAS_ATTRIBUTE_pure 1
# define RBIMPL_HAS_ATTRIBUTE_pure 1
# endif
# ifdef NO_ADDRESS_SAFETY_ANALYSIS
# define RUBY3_HAS_ATTRIBUTE_no_address_safety_analysis 1
# define RBIMPL_HAS_ATTRIBUTE_no_address_safety_analysis 1
# endif
# ifdef NO_SANITIZE
# define RUBY3_HAS_ATTRIBUTE_no_sanitize 1
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize 1
# endif
# ifdef NO_SANITIZE_ADDRESS
# define RUBY3_HAS_ATTRIBUTE_no_sanitize_address 1
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize_address 1
# endif
# ifdef NOINLINE
# define RUBY3_HAS_ATTRIBUTE_noinline 1
# define RBIMPL_HAS_ATTRIBUTE_noinline 1
# endif
# ifdef RUBY3_FUNC_NONNULL
# define RUBY3_HAS_ATTRIBUTE_nonnull 1
# ifdef RBIMPL_FUNC_NONNULL
# define RBIMPL_HAS_ATTRIBUTE_nonnull 1
# endif
# ifdef NORETURN
# define RUBY3_HAS_ATTRIBUTE_noreturn 1
# define RBIMPL_HAS_ATTRIBUTE_noreturn 1
# endif
# ifdef FUNC_OPTIMIZED
# define RUBY3_HAS_ATTRIBUTE_optimize 1
# define RBIMPL_HAS_ATTRIBUTE_optimize 1
# endif
# ifdef FUNC_STDCALL
# define RUBY3_HAS_ATTRIBUTE_stdcall 1
# define RBIMPL_HAS_ATTRIBUTE_stdcall 1
# endif
# ifdef MAYBE_UNUSED
# define RUBY3_HAS_ATTRIBUTE_unused 1
# define RBIMPL_HAS_ATTRIBUTE_unused 1
# endif
# ifdef WARN_UNUSED_RESULT
# define RUBY3_HAS_ATTRIBUTE_warn_unused_result 1
# define RBIMPL_HAS_ATTRIBUTE_warn_unused_result 1
# endif
# ifdef WARNINGFUNC
# define RUBY3_HAS_ATTRIBUTE_warning 1
# define RBIMPL_HAS_ATTRIBUTE_warning 1
# endif
# ifdef WEAK
# define RUBY3_HAS_ATTRIBUTE_weak 1
# define RBIMPL_HAS_ATTRIBUTE_weak 1
# endif
#endif
#endif /* RUBY3_HAS_ATTRIBUTE_H */
#endif /* RBIMPL_HAS_ATTRIBUTE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_HAS_BUILTIN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_BUILTIN_H
#ifndef RBIMPL_HAS_BUILTIN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_HAS_BUILTIN_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,88 +18,88 @@
* 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_HAS_BUILTIN.
* @brief Defines #RBIMPL_HAS_BUILTIN.
*/
#include "ruby/impl/config.h"
#include "ruby/impl/compiler_since.h"
#include "ruby/impl/token_paste.h"
#if defined(__has_builtin)
# if RUBY3_COMPILER_IS(Intel)
# if RBIMPL_COMPILER_IS(Intel)
# /* :TODO: Intel C Compiler has __has_builtin (since 19.1 maybe?), and is
# * reportedly broken. We have to skip them. However the situation can
# * change. They might improve someday. We need to revisit here later. */
# elif RUBY3_COMPILER_IS(GCC) && ! __has_builtin(__builtin_alloca)
# elif RBIMPL_COMPILER_IS(GCC) && ! __has_builtin(__builtin_alloca)
# /* FreeBSD's <sys/cdefs.h> defines its own *broken* version of
# * __has_builtin. Cygwin copied that content to be a victim of the
# * broken-ness. We don't take them into account. */
# else
# define RUBY3_HAVE___HAS_BUILTIN 1
# define RBIMPL_HAVE___HAS_BUILTIN 1
# endif
#endif
/** Wraps (or simulates) `__has_builtin`. */
#if defined(RUBY3_HAVE___HAS_BUILTIN)
# define RUBY3_HAS_BUILTIN(_) __has_builtin(_)
#if defined(RBIMPL_HAVE___HAS_BUILTIN)
# define RBIMPL_HAS_BUILTIN(_) __has_builtin(_)
#elif RUBY3_COMPILER_IS(GCC)
#elif RBIMPL_COMPILER_IS(GCC)
# /* :FIXME: Historically GCC has had tons of builtins, but it implemented
# * __has_builtin only since GCC 10. This section can be made more
# * granular. */
# /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66970 */
# define RUBY3_HAS_BUILTIN(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_BUILTIN_, _)
# define RUBY3_HAS_BUILTIN___builtin_add_overflow RUBY3_COMPILER_SINCE(GCC, 5, 1, 0)
# define RUBY3_HAS_BUILTIN___builtin_alloca RUBY3_COMPILER_SINCE(GCC, 0, 0, 0)
# define RUBY3_HAS_BUILTIN___builtin_alloca_with_align RUBY3_COMPILER_SINCE(GCC, 6, 1, 0)
# define RBIMPL_HAS_BUILTIN(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_BUILTIN_, _)
# define RBIMPL_HAS_BUILTIN___builtin_add_overflow RBIMPL_COMPILER_SINCE(GCC, 5, 1, 0)
# define RBIMPL_HAS_BUILTIN___builtin_alloca RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
# define RBIMPL_HAS_BUILTIN___builtin_alloca_with_align RBIMPL_COMPILER_SINCE(GCC, 6, 1, 0)
# /* See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 for bswap16. */
# define RUBY3_HAS_BUILTIN___builtin_bswap16 RUBY3_COMPILER_SINCE(GCC, 4, 8, 0)
# define RUBY3_HAS_BUILTIN___builtin_bswap32 RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_bswap64 RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_clz RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_clzl RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_clzll RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_constant_p RUBY3_COMPILER_SINCE(GCC, 2,95, 3)
# define RUBY3_HAS_BUILTIN___builtin_ctz RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_ctzl RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_ctzll RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_expect RUBY3_COMPILER_SINCE(GCC, 3, 0, 0)
# define RUBY3_HAS_BUILTIN___builtin_mul_overflow RUBY3_COMPILER_SINCE(GCC, 5, 1, 0)
# define RUBY3_HAS_BUILTIN___builtin_mul_overflow_p RUBY3_COMPILER_SINCE(GCC, 7, 0, 0)
# define RUBY3_HAS_BUILTIN___builtin_popcount RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_popcountl RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_popcountll RUBY3_COMPILER_SINCE(GCC, 3, 6, 0)
# define RUBY3_HAS_BUILTIN___builtin_sub_overflow RUBY3_COMPILER_SINCE(GCC, 5, 1, 0)
# define RUBY3_HAS_BUILTIN___builtin_unreachable RUBY3_COMPILER_SINCE(GCC, 4, 5, 0)
# define RBIMPL_HAS_BUILTIN___builtin_bswap16 RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
# define RBIMPL_HAS_BUILTIN___builtin_bswap32 RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_bswap64 RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_clz RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_clzl RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_clzll RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_constant_p RBIMPL_COMPILER_SINCE(GCC, 2,95, 3)
# define RBIMPL_HAS_BUILTIN___builtin_ctz RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_ctzl RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_ctzll RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_expect RBIMPL_COMPILER_SINCE(GCC, 3, 0, 0)
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow RBIMPL_COMPILER_SINCE(GCC, 5, 1, 0)
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow_p RBIMPL_COMPILER_SINCE(GCC, 7, 0, 0)
# define RBIMPL_HAS_BUILTIN___builtin_popcount RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_popcountl RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_popcountll RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
# define RBIMPL_HAS_BUILTIN___builtin_sub_overflow RBIMPL_COMPILER_SINCE(GCC, 5, 1, 0)
# define RBIMPL_HAS_BUILTIN___builtin_unreachable RBIMPL_COMPILER_SINCE(GCC, 4, 5, 0)
# /* Note that "0, 0, 0" might be inaccurate. */
#elif RUBY3_COMPILER_IS(MSVC)
#elif RBIMPL_COMPILER_IS(MSVC)
# /* MSVC has UNREACHABLE, but that is not __builtin_unreachable. */
# define RUBY3_HAS_BUILTIN(_) 0
# define RBIMPL_HAS_BUILTIN(_) 0
#else
# /* Take config.h definition when available */
# define RUBY3_HAS_BUILTIN(_) (RUBY3_TOKEN_PASTE(RUBY3_HAS_BUILTIN_, _)+0)
# define RUBY3_HAS_BUILTIN___builtin_add_overflow HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
# define RUBY3_HAS_BUILTIN___builtin_alloca_with_align HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN
# define RUBY3_HAS_BUILTIN___builtin_assume_aligned HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED
# define RUBY3_HAS_BUILTIN___builtin_bswap16 HAVE_BUILTIN___BUILTIN_BSWAP16
# define RUBY3_HAS_BUILTIN___builtin_bswap32 HAVE_BUILTIN___BUILTIN_BSWAP32
# define RUBY3_HAS_BUILTIN___builtin_bswap64 HAVE_BUILTIN___BUILTIN_BSWAP64
# define RUBY3_HAS_BUILTIN___builtin_clz HAVE_BUILTIN___BUILTIN_CLZ
# define RUBY3_HAS_BUILTIN___builtin_clzl HAVE_BUILTIN___BUILTIN_CLZL
# define RUBY3_HAS_BUILTIN___builtin_clzll HAVE_BUILTIN___BUILTIN_CLZLL
# define RUBY3_HAS_BUILTIN___builtin_constant_p HAVE_BUILTIN___BUILTIN_CONSTANT_P
# define RUBY3_HAS_BUILTIN___builtin_ctz HAVE_BUILTIN___BUILTIN_CTZ
# define RUBY3_HAS_BUILTIN___builtin_ctzll HAVE_BUILTIN___BUILTIN_CTZLL
# define RUBY3_HAS_BUILTIN___builtin_expect HAVE_BUILTIN___BUILTIN_EXPECT
# define RUBY3_HAS_BUILTIN___builtin_mul_overflow HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
# define RUBY3_HAS_BUILTIN___builtin_mul_overflow_p HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
# define RUBY3_HAS_BUILTIN___builtin_popcount HAVE_BUILTIN___BUILTIN_POPCOUNT
# define RUBY3_HAS_BUILTIN___builtin_popcountll HAVE_BUILTIN___BUILTIN_POPCOUNTLL
# define RUBY3_HAS_BUILTIN___builtin_sub_overflow HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW
# define RBIMPL_HAS_BUILTIN(_) (RBIMPL_TOKEN_PASTE(RBIMPL_HAS_BUILTIN_, _)+0)
# define RBIMPL_HAS_BUILTIN___builtin_add_overflow HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
# define RBIMPL_HAS_BUILTIN___builtin_alloca_with_align HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN
# define RBIMPL_HAS_BUILTIN___builtin_assume_aligned HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED
# define RBIMPL_HAS_BUILTIN___builtin_bswap16 HAVE_BUILTIN___BUILTIN_BSWAP16
# define RBIMPL_HAS_BUILTIN___builtin_bswap32 HAVE_BUILTIN___BUILTIN_BSWAP32
# define RBIMPL_HAS_BUILTIN___builtin_bswap64 HAVE_BUILTIN___BUILTIN_BSWAP64
# define RBIMPL_HAS_BUILTIN___builtin_clz HAVE_BUILTIN___BUILTIN_CLZ
# define RBIMPL_HAS_BUILTIN___builtin_clzl HAVE_BUILTIN___BUILTIN_CLZL
# define RBIMPL_HAS_BUILTIN___builtin_clzll HAVE_BUILTIN___BUILTIN_CLZLL
# define RBIMPL_HAS_BUILTIN___builtin_constant_p HAVE_BUILTIN___BUILTIN_CONSTANT_P
# define RBIMPL_HAS_BUILTIN___builtin_ctz HAVE_BUILTIN___BUILTIN_CTZ
# define RBIMPL_HAS_BUILTIN___builtin_ctzll HAVE_BUILTIN___BUILTIN_CTZLL
# define RBIMPL_HAS_BUILTIN___builtin_expect HAVE_BUILTIN___BUILTIN_EXPECT
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow_p HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
# define RBIMPL_HAS_BUILTIN___builtin_popcount HAVE_BUILTIN___BUILTIN_POPCOUNT
# define RBIMPL_HAS_BUILTIN___builtin_popcountll HAVE_BUILTIN___BUILTIN_POPCOUNTLL
# define RBIMPL_HAS_BUILTIN___builtin_sub_overflow HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW
# if defined(UNREACHABLE)
# define RUBY3_HAS_BUILTIN___builtin_unreachable 1
# define RBIMPL_HAS_BUILTIN___builtin_unreachable 1
# endif
#endif
#endif /* RUBY3_HAS_BUILTIN_H */
#endif /* RBIMPL_HAS_BUILTIN_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_HAS_C_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_C_ATTRIBUTE_H
#ifndef RBIMPL_HAS_C_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_HAS_C_ATTRIBUTE_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_HAS_C_ATTRIBUTE.
* @brief Defines #RBIMPL_HAS_C_ATTRIBUTE.
*/
/** Wraps (or simulates) `__has_c_attribute`. */
#if defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_C_ATTRIBUTE(_) 0
# define RBIMPL_HAS_C_ATTRIBUTE(_) 0
#elif defined(__has_c_attribute)
# define RUBY3_HAS_C_ATTRIBUTE(_) __has_c_attribute(_)
# define RBIMPL_HAS_C_ATTRIBUTE(_) __has_c_attribute(_)
#else
# /* As of writing everything that lacks __has_c_attribute also completely
# * lacks C2x attributes as well. Might change in future? */
# define RUBY3_HAS_C_ATTRIBUTE(_) 0
# define RBIMPL_HAS_C_ATTRIBUTE(_) 0
#endif
#endif /* RUBY3_HAS_C_ATTRIBUTE_H */
#endif /* RBIMPL_HAS_C_ATTRIBUTE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_HAS_CPP_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_CPP_ATTRIBUTE_H
#ifndef RBIMPL_HAS_CPP_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_HAS_CPP_ATTRIBUTE_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_HAS_CPP_ATTRIBUTE.
* @brief Defines #RBIMPL_HAS_CPP_ATTRIBUTE.
*/
#include "ruby/impl/compiler_is.h"
#include "ruby/impl/compiler_since.h"
@ -26,35 +26,35 @@
/** @cond INTERNAL_MACRO */
#if defined(__has_cpp_attribute)
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_)
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_)
#elif RUBY3_COMPILER_IS(MSVC)
#elif RBIMPL_COMPILER_IS(MSVC)
# /* MSVC has never updated its __cplusplus since forever (unless specified
# * explicitly by a compiler flag). They also lack __has_cpp_attribute until
# * 2019. However, they do have attributes since 2015 or so. */
# /* https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance */
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_CPP_ATTRIBUTE_, _)
# define RUBY3_HAS_CPP_ATTRIBUTE_noreturn 200809 * RUBY3_COMPILER_SINCE(MSVC, 19, 00, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_carries_dependency 200809 * RUBY3_COMPILER_SINCE(MSVC, 19, 00, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_deprecated 201309 * RUBY3_COMPILER_SINCE(MSVC, 19, 10, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_fallthrough 201603 * RUBY3_COMPILER_SINCE(MSVC, 19, 10, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_maybe_unused 201603 * RUBY3_COMPILER_SINCE(MSVC, 19, 11, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_nodiscard 201603 * RUBY3_COMPILER_SINCE(MSVC, 19, 11, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_CPP_ATTRIBUTE_, _)
# define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_carries_dependency 200809 * RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(MSVC, 19, 10, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_fallthrough 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 10, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_maybe_unused 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_nodiscard 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 0)
#elif RUBY3_COMPILER_BEFORE(Clang, 3, 6, 0)
#elif RBIMPL_COMPILER_BEFORE(Clang, 3, 6, 0)
# /* Clang 3.6.0 introduced __has_cpp_attribute. Prior to that following
# * attributes were already there. */
# /* https://clang.llvm.org/cxx_status.html */
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_CPP_ATTRIBUTE_, _)
# define RUBY3_HAS_CPP_ATTRIBUTE_noreturn 200809 * RUBY3_COMPILER_SINCE(Clang, 3, 3, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_deprecated 201309 * RUBY3_COMPILER_SINCE(Clang, 3, 4, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_CPP_ATTRIBUTE_, _)
# define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(Clang, 3, 3, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(Clang, 3, 4, 0)
#elif RUBY3_COMPILER_BEFORE(GCC, 5, 0, 0)
#elif RBIMPL_COMPILER_BEFORE(GCC, 5, 0, 0)
# /* GCC 5+ have __has_cpp_attribute, while 4.x had following attributes. */
# /* https://gcc.gnu.org/projects/cxx-status.html */
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_CPP_ATTRIBUTE_, _)
# define RUBY3_HAS_CPP_ATTRIBUTE_noreturn 200809 * RUBY3_COMPILER_SINCE(GCC, 4, 8, 0)
# define RUBY3_HAS_CPP_ATTRIBUTE_deprecated 201309 * RUBY3_COMPILER_SINCE(GCC, 4, 9, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_CPP_ATTRIBUTE_, _)
# define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
#else
# /* :FIXME:
@ -62,18 +62,18 @@
# * - icpc: They have __INTEL_CXX11_MODE__.
# * - SunPro: Seems they support C++11.
# */
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) 0
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) 0
#endif
/** @endcond */
/** Wraps (or simulates) `__has_cpp_attribute`. */
#if ! defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_CPP_ATTRIBUTE(_) 0
# define RBIMPL_HAS_CPP_ATTRIBUTE(_) 0
#else
# /* GCC needs workarounds. See https://gcc.godbolt.org/z/jdz3pa */
# define RUBY3_HAS_CPP_ATTRIBUTE(_) \
((RUBY3_HAS_CPP_ATTRIBUTE0(_) <= __cplusplus) ? RUBY3_HAS_CPP_ATTRIBUTE0(_) : 0)
# define RBIMPL_HAS_CPP_ATTRIBUTE(_) \
((RBIMPL_HAS_CPP_ATTRIBUTE0(_) <= __cplusplus) ? RBIMPL_HAS_CPP_ATTRIBUTE0(_) : 0)
#endif
#endif /* RUBY3_HAS_CPP_ATTRIBUTE_H */
#endif /* RBIMPL_HAS_CPP_ATTRIBUTE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_HAS_DECLSPEC_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_DECLSPEC_ATTRIBUTE_H
#ifndef RBIMPL_HAS_DECLSPEC_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_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,31 +18,31 @@
* 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_HAS_DECLSPEC_ATTRIBUTE.
* @brief Defines #RBIMPL_HAS_DECLSPEC_ATTRIBUTE.
*/
#include "ruby/impl/compiler_since.h"
#include "ruby/impl/token_paste.h"
/** Wraps (or simulates) `__has_declspec_attribute`. */
#if defined(__has_declspec_attribute)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE(_) __has_declspec_attribute(_)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE(_) __has_declspec_attribute(_)
#else
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_DECLSPEC_ATTRIBUTE_, _)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_align RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_deprecated RUBY3_COMPILER_SINCE(MSVC,13, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_dllexport RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_dllimport RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_empty_bases RUBY3_COMPILER_SINCE(MSVC,19, 0, 23918)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_noalias RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_noinline RUBY3_COMPILER_SINCE(MSVC,13, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_noreturn RUBY3_COMPILER_SINCE(MSVC,11, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_nothrow RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_restrict RUBY3_COMPILER_SINCE(MSVC,14, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_DECLSPEC_ATTRIBUTE_, _)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_align RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_deprecated RBIMPL_COMPILER_SINCE(MSVC,13, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_dllexport RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_dllimport RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_empty_bases RBIMPL_COMPILER_SINCE(MSVC,19, 0, 23918)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_noalias RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_noinline RBIMPL_COMPILER_SINCE(MSVC,13, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_noreturn RBIMPL_COMPILER_SINCE(MSVC,11, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_nothrow RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_restrict RBIMPL_COMPILER_SINCE(MSVC,14, 0, 0)
# /* Note that "8, 0, 0" might be inaccurate. */
# if ! defined(__cplusplus)
# /* Clang has this in both C/C++, but MSVC has this in C++ only.*/
# undef RUBY3_HAS_DECLSPEC_ATTRIBUTE_nothrow
# undef RBIMPL_HAS_DECLSPEC_ATTRIBUTE_nothrow
# endif
#endif
#endif /* RUBY3_HAS_DECLSPEC_ATTRIBUTE_H */
#endif /* RBIMPL_HAS_DECLSPEC_ATTRIBUTE_H */

Просмотреть файл

@ -1,5 +1,5 @@
#ifndef RUBY3_HAS_EXTENSION_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_EXTENSION_H
#ifndef RBIMPL_HAS_EXTENSION_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_HAS_EXTENSION_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_HAS_EXTENSION.
* @brief Defines #RBIMPL_HAS_EXTENSION.
*/
#include "ruby/impl/has/feature.h"
/** Wraps (or simulates) `__has_extension`. */
#if defined(__has_extension)
# define RUBY3_HAS_EXTENSION(_) __has_extension(_)
# define RBIMPL_HAS_EXTENSION(_) __has_extension(_)
#else
# /* Pre-3.0 clang had __has_feature but not __has_extension. */
# define RUBY3_HAS_EXTENSION(_) RUBY3_HAS_FEATURE(_)
# define RBIMPL_HAS_EXTENSION(_) RBIMPL_HAS_FEATURE(_)
#endif
#endif /* RUBY3_HAS_EXTENSION_H */
#endif /* RBIMPL_HAS_EXTENSION_H */

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше