ext/cairo/rb_cairo_rectangle.c in cairo-1.17.6 vs ext/cairo/rb_cairo_rectangle.c in cairo-1.17.7

- old
+ new

@@ -1,10 +1,10 @@ /* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */ /* * Ruby Cairo Binding * - * Copyright 2005-2014 Kouhei Sutou <kou@cozmixng.org> + * Copyright 2005-2022 Sutou Kouhei <kou@cozmixng.org> * * This file is made available under the same terms as Ruby * */ @@ -13,13 +13,24 @@ VALUE rb_cCairo_Rectangle; #define _SELF ((cairo_rectangle_int_t *)DATA_PTR (self)) #if CAIRO_CHECK_VERSION(1, 10, 0) +static const rb_data_type_t cr_rectangle_type = { + "Cairo::Rectangle", + { + NULL, + ruby_xfree, + }, + NULL, + NULL, + RUBY_TYPED_FREE_IMMEDIATELY, +}; + static VALUE cr_rectangle_allocate (VALUE klass) { - return Data_Wrap_Struct (klass, NULL, xfree, NULL); + return TypedData_Wrap_Struct (klass, &cr_rectangle_type, NULL); } static VALUE cr_rectangle_initialize (VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)