[前][次][番号順一覧][スレッド一覧]

ruby-changes:38477

From: nobu <ko1@a...>
Date: Wed, 20 May 2015 14:09:19 +0900 (JST)
Subject: [ruby-changes:38477] nobu:r50558 (trunk): ruby.h: warn old names

nobu	2015-05-20 14:09:00 +0900 (Wed, 20 May 2015)

  New Revision: 50558

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50558

  Log:
    ruby.h: warn old names
    
    * include/ruby/ruby.h (rb_data_typed_object_alloc),
      (rb_data_object_alloc): warn use of old names.

  Modified files:
    trunk/gc.c
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 50557)
+++ include/ruby/ruby.h	(revision 50558)
@@ -1013,8 +1013,6 @@ typedef void (*RUBY_DATA_FUNC)(void*); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1013
 #   define RUBY_UNTYPED_DATA_WARNING 0
 # endif
 #endif
-#define rb_data_object_alloc rb_data_object_wrap
-#define rb_data_typed_object_alloc rb_data_typed_object_wrap
 VALUE rb_data_object_wrap(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
 VALUE rb_data_object_zalloc(VALUE,size_t,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
 VALUE rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *);
@@ -1245,6 +1243,24 @@ rb_data_typed_object_make(VALUE klass, c https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1243
     return result;
 }
 
+#ifndef rb_data_object_alloc
+DEPRECATED_BY(rb_data_object_wrap, static inline VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
+static inline VALUE
+rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
+{
+    return rb_data_object_wrap(klass, data, dmark, dfree);
+}
+#endif
+
+#ifndef rb_data_typed_object_alloc
+DEPRECATED_BY(rb_data_typed_object_wrap, static inline VALUE rb_data_typed_object_alloc(VALUE,void*,const rb_data_type_t*));
+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
+
 #define rb_data_object_wrap_0 rb_data_object_wrap
 #define rb_data_object_wrap_1 rb_data_object_wrap_warning
 #define rb_data_object_wrap  RUBY_MACRO_SELECT(rb_data_object_wrap_, RUBY_UNTYPED_DATA_WARNING)
Index: gc.c
===================================================================
--- gc.c	(revision 50557)
+++ gc.c	(revision 50558)
@@ -11,6 +11,9 @@ https://github.com/ruby/ruby/blob/trunk/gc.c#L11
 
 **********************************************************************/
 
+#define rb_data_object_alloc rb_data_object_alloc
+#define rb_data_typed_object_alloc rb_data_typed_object_alloc
+
 #include "internal.h"
 #include "ruby/st.h"
 #include "ruby/re.h"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]