aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-07-27 16:15:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-22 02:51:49 +0900
commitc30f03d32833f38fedf41ecb08f1ade9c6657fef (patch)
tree735949b112c79e5c0c78aa3509d1119e8884a006 /object.c
parent5c0abe2d94c545275079a862dc36bb163953010a (diff)
downloadruby-c30f03d32833f38fedf41ecb08f1ade9c6657fef.tar.gz
Data: delete
Has been deprecated since 684bdf6171b76f5bc5e4f05926a5ab01ec2b4fd5. Matz says in [ruby-core:83954] that Data should be an alias of Object. Because rb_cData has not been deprecated, let us deprecate the constant to make it a C-level synonym of rb_cObject.
Diffstat (limited to 'object.c')
-rw-r--r--object.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/object.c b/object.c
index 8626d5c6b7..bf65254f54 100644
--- a/object.c
+++ b/object.c
@@ -32,6 +32,7 @@
#include "internal/struct.h"
#include "internal/symbol.h"
#include "internal/variable.h"
+#include "internal/warnings.h"
#include "probes.h"
#include "ruby/encoding.h"
#include "ruby/st.h"
@@ -4330,6 +4331,25 @@ f_sprintf(int c, const VALUE *v, VALUE _)
return rb_f_sprintf(c, v);
}
+COMPILER_WARNING_PUSH
+#if defined(_MSC_VER)
+COMPILER_WARNING_IGNORED(4996)
+#elif defined(__INTEL_COMPILER)
+COMPILER_WARNING_IGNORED(1786)
+#elif __has_warning("-Wdeprecated-declarations")
+COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
+#elif defined(__GNUC__)
+COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
+
+static inline void
+Init_rb_cData(void)
+{
+ rb_cData = rb_cObject;
+}
+
+COMPILER_WARNING_POP
+
/*
* Document-class: Class
*
@@ -4662,15 +4682,7 @@ InitVM_Object(void)
rb_undef_method(rb_cClass, "append_features");
rb_undef_method(rb_cClass, "prepend_features");
- /*
- * Document-class: Data
- *
- * This is a deprecated class, base class for C extensions using
- * Data_Make_Struct or Data_Wrap_Struct.
- */
- rb_cData = rb_define_class("Data", rb_cObject);
- rb_undef_alloc_func(rb_cData);
- rb_deprecate_constant(rb_cObject, "Data");
+ Init_rb_cData();
rb_cTrueClass = rb_define_class("TrueClass", rb_cObject);
rb_cTrueClass_to_s = rb_fstring_enc_lit("true", rb_usascii_encoding());