ext/glib2/rbglib_regex.c in glib2-3.4.3 vs ext/glib2/rbglib_regex.c in glib2-3.4.4

- old
+ new

@@ -1,7 +1,7 @@ /* - * Copyright (C) 2015-2019 Ruby-GNOME2 Project Team + * Copyright (C) 2015-2021 Ruby-GNOME Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. @@ -134,11 +134,10 @@ RAISE_GERROR(error); return STRV2RVAL_FREE(strings); } -#if GLIB_CHECK_VERSION(2, 30, 0) static VALUE rg_match(gint argc, VALUE *argv, VALUE self) { VALUE rb_string, rb_start_position, rb_match_options, rb_options; VALUE rb_frozen_string, rb_match_info; @@ -189,11 +188,10 @@ rb_match_info = GMATCHINFO2RVAL(match_info); g_match_info_unref(match_info); rb_iv_set(rb_match_info, "@string", rb_frozen_string); return rb_match_info; } -#endif static VALUE rg_max_backref(VALUE self) { return INT2NUM(g_regex_get_max_backref(_SELF(self))); @@ -203,11 +201,10 @@ rg_capture_count(VALUE self) { return INT2NUM(g_regex_get_capture_count(_SELF(self))); } -#if GLIB_CHECK_VERSION(2, 34, 0) static VALUE rg_has_cr_or_lf_p(VALUE self) { return CBOOL2RVAL(g_regex_get_has_cr_or_lf(_SELF(self))); } @@ -215,19 +212,17 @@ static VALUE rg_max_lookbehind(VALUE self) { return INT2NUM(g_regex_get_max_lookbehind(_SELF(self))); } -#endif static VALUE rg_string_number(VALUE self, VALUE string) { return INT2NUM(g_regex_get_string_number(_SELF(self), RVAL2CSTR(string))); } -#if GLIB_CHECK_VERSION(2, 30, 0) static VALUE rg_match_all(gint argc, VALUE *argv, VALUE self) { VALUE rb_string, rb_start_position, rb_match_options, rb_options; VALUE rb_frozen_string, rb_match_info; @@ -421,11 +416,10 @@ if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(modified_string); } -#endif static VALUE rg_s_escape_string(G_GNUC_UNUSED VALUE self, VALUE string) { return CSTR2RVAL(g_regex_escape_string(RVAL2CSTR(string), @@ -470,23 +464,17 @@ RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(pattern, 0); RG_DEF_METHOD(compile_flags, 0); RG_DEF_METHOD(match_flags, 0); RG_DEF_METHOD(split, -1); -#if GLIB_CHECK_VERSION(2, 30, 0) RG_DEF_METHOD(match, -1); -#endif RG_DEF_METHOD(max_backref, 0); RG_DEF_METHOD(capture_count, 0); -#if GLIB_CHECK_VERSION(2, 34, 0) RG_DEF_METHOD_P(has_cr_or_lf, 0); RG_DEF_METHOD(max_lookbehind, 0); -#endif RG_DEF_METHOD(string_number, 1); -#if GLIB_CHECK_VERSION(2, 30, 0) RG_DEF_METHOD(match_all, -1); RG_DEF_METHOD(replace, -1); -#endif RG_DEF_SMETHOD(escape_string, 1); RG_DEF_SMETHOD(check_replacement, 1); RG_DEF_SMETHOD_P(have_reference, 1);