summaryrefslogtreecommitdiff
path: root/include/ruby/impl/core
diff options
context:
space:
mode:
author卜部昌平 <[email protected]>2020-05-04 15:52:56 +0900
committer卜部昌平 <[email protected]>2020-05-11 09:24:08 +0900
commit97672f669af53c41b094772559030195787406be (patch)
tree71902d58cda65825046cff5e42723dfa0d0280af /include/ruby/impl/core
parentd7f4d732c199df24620a162372c71ee83ed21e62 (diff)
sed -i s/RUBY3/RBIMPL/g
Devs do not love "3". The only exception is RUBY3_KEYWORDS in parse.y, which seems unrelated to our interests.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3079
Diffstat (limited to 'include/ruby/impl/core')
-rw-r--r--include/ruby/impl/core/rarray.h72
-rw-r--r--include/ruby/impl/core/rbasic.h36
-rw-r--r--include/ruby/impl/core/rbignum.h16
-rw-r--r--include/ruby/impl/core/rclass.h14
-rw-r--r--include/ruby/impl/core/rdata.h56
-rw-r--r--include/ruby/impl/core/rfile.h10
-rw-r--r--include/ruby/impl/core/rhash.h12
-rw-r--r--include/ruby/impl/core/rmatch.h20
-rw-r--r--include/ruby/impl/core/robject.h24
-rw-r--r--include/ruby/impl/core/rregexp.h30
-rw-r--r--include/ruby/impl/core/rstring.h54
-rw-r--r--include/ruby/impl/core/rstruct.h24
-rw-r--r--include/ruby/impl/core/rtypeddata.h42
13 files changed, 205 insertions, 205 deletions
diff --git a/include/ruby/impl/core/rarray.h b/include/ruby/impl/core/rarray.h
index 63ebb09d60..8906cd29d9 100644
--- a/include/ruby/impl/core/rarray.h
+++ b/include/ruby/impl/core/rarray.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rbasic.h b/include/ruby/impl/core/rbasic.h
index f1c05e57fb..7c04d64398 100644
--- a/include/ruby/impl/core/rbasic.h
+++ b/include/ruby/impl/core/rbasic.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rbignum.h b/include/ruby/impl/core/rbignum.h
index 5adc82bee8..4922ef1c17 100644
--- a/include/ruby/impl/core/rbignum.h
+++ b/include/ruby/impl/core/rbignum.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rclass.h b/include/ruby/impl/core/rclass.h
index d9e08a3c75..6926ac4780 100644
--- a/include/ruby/impl/core/rclass.h
+++ b/include/ruby/impl/core/rclass.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rdata.h b/include/ruby/impl/core/rdata.h
index eac05dbf2e..5ae492d728 100644
--- a/include/ruby/impl/core/rdata.h
+++ b/include/ruby/impl/core/rdata.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rfile.h b/include/ruby/impl/core/rfile.h
index 7c162bd9de..eb3ca7cf52 100644
--- a/include/ruby/impl/core/rfile.h
+++ b/include/ruby/impl/core/rfile.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rhash.h b/include/ruby/impl/core/rhash.h
index 7cd0386c6f..d0ef1a56f0 100644
--- a/include/ruby/impl/core/rhash.h
+++ b/include/ruby/impl/core/rhash.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rmatch.h b/include/ruby/impl/core/rmatch.h
index f47b5d966d..dea929c38b 100644
--- a/include/ruby/impl/core/rmatch.h
+++ b/include/ruby/impl/core/rmatch.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/robject.h b/include/ruby/impl/core/robject.h
index 7464af74c6..df0ab31a54 100644
--- a/include/ruby/impl/core/robject.h
+++ b/include/ruby/impl/core/robject.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rregexp.h b/include/ruby/impl/core/rregexp.h
index e40b8d19bd..74ef52d7ae 100644
--- a/include/ruby/impl/core/rregexp.h
+++ b/include/ruby/impl/core/rregexp.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rstring.h b/include/ruby/impl/core/rstring.h
index df0b4c4fb3..ab89bcd3e3 100644
--- a/include/ruby/impl/core/rstring.h
+++ b/include/ruby/impl/core/rstring.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rstruct.h b/include/ruby/impl/core/rstruct.h
index 4cbe643244..c63bab7861 100644
--- a/include/ruby/impl/core/rstruct.h
+++ b/include/ruby/impl/core/rstruct.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 <[email protected]>
@@ -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 */
diff --git a/include/ruby/impl/core/rtypeddata.h b/include/ruby/impl/core/rtypeddata.h
index 548d316122..0532baad68 100644
--- a/include/ruby/impl/core/rtypeddata.h
+++ b/include/ruby/impl/core/rtypeddata.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 <[email protected]>
@@ -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 */