summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-27 01:28:47 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-27 01:28:47 (GMT)
commitbb10a21346fb1e66f581c8ef3110649b1ecb355a (patch)
treecc6fa8578838df1ba204b3a035d5293632f071bf /include
parent2a8989d71c611884631c4d9ff5dba65aed00cc83 (diff)
ruby.h: deprecate plain Data
* include/ruby/ruby.h (rb_data_object_alloc_deprecated): deprecate Data_Make_Struct and Data_Wrap_Struct. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 6a3949a..59c2d54 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -973,7 +973,23 @@ struct RTypedData {
*/
typedef void (*RUBY_DATA_FUNC)(void*);
+#ifndef RUBY_DEPRECATE_DATA_WRAP_STRUCT
+# ifdef RUBY_EXPORT
+# define RUBY_DEPRECATE_DATA_WRAP_STRUCT 1
+# else
+# define RUBY_DEPRECATE_DATA_WRAP_STRUCT 0
+# endif
+#endif
VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
+#if RUBY_DEPRECATE_DATA_WRAP_STRUCT
+DEPRECATED(static inline VALUE rb_data_object_alloc_deprecated(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
+static inline VALUE
+rb_data_object_alloc_deprecated(VALUE klass, void *ptr, RUBY_DATA_FUNC mark, RUBY_DATA_FUNC free)
+{
+ return rb_data_object_alloc(klass, ptr, mark, free);
+}
+#define rb_data_object_alloc rb_data_object_alloc_deprecated
+#endif
VALUE rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *);
int rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent);
int rb_typeddata_is_kind_of(VALUE, const rb_data_type_t *);