From 26f59b09fe3a1c2ec50145f7c3d5b425f48a7a32 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 1 Aug 2016 07:23:56 +0000 Subject: hide struct internal [Feature #9916] * include/ruby/ruby.h (struct RStruct): no longer. * internal.h (struct RStruct): moved here. * struct.c (rb_struct_ptr): a compensation function for the lack of RSTRUCT_PTR. But now that we have RSTRUCT_GET/SET, that must not be used anyway. I mark this deprecated. Dont use it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index a4cab45945..150ca20a39 100644 --- a/struct.c +++ b/struct.c @@ -616,9 +616,6 @@ rb_struct_new(VALUE klass, ...) return rb_class_new_instance(size, mem, klass); } -static VALUE -rb_struct_size(VALUE s); - static VALUE struct_enum_size(VALUE s, VALUE args, VALUE eobj) { @@ -1123,12 +1120,18 @@ rb_struct_eql(VALUE s, VALUE s2) * joe.length #=> 3 */ -static VALUE +VALUE rb_struct_size(VALUE s) { return LONG2FIX(RSTRUCT_LEN(s)); } +const VALUE* +rb_struct_ptr(VALUE s) +{ + return RSTRUCT_CONST_PTR(s); +} + /* * call-seq: * struct.dig(key, ...) -> object -- cgit v1.2.3