glib2 3.4.3 → 3.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/ext/glib2/extconf.rb +1 -5
  4. data/ext/glib2/rbglib-bytes.c +1 -5
  5. data/ext/glib2/rbglib-gc.c +98 -52
  6. data/ext/glib2/rbglib-variant-type.c +1 -5
  7. data/ext/glib2/rbglib-variant.c +3 -5
  8. data/ext/glib2/rbglib.c +4 -0
  9. data/ext/glib2/rbglib.h +4 -1
  10. data/ext/glib2/rbglib_bookmarkfile.c +1 -1
  11. data/ext/glib2/rbglib_datetime.c +1 -5
  12. data/ext/glib2/rbglib_fileutils.c +1 -17
  13. data/ext/glib2/rbglib_iochannel.c +4 -4
  14. data/ext/glib2/rbglib_keyfile.c +1 -35
  15. data/ext/glib2/rbglib_maincontext.c +6 -32
  16. data/ext/glib2/rbglib_mainloop.c +2 -17
  17. data/ext/glib2/rbglib_matchinfo.c +1 -5
  18. data/ext/glib2/rbglib_pollfd.c +1 -25
  19. data/ext/glib2/rbglib_regex.c +1 -13
  20. data/ext/glib2/rbglib_source.c +1 -39
  21. data/ext/glib2/rbglib_spawn.c +5 -10
  22. data/ext/glib2/rbglib_spawnerror.c +2 -2
  23. data/ext/glib2/rbglib_threads.c +2 -15
  24. data/ext/glib2/rbglib_timezone.c +1 -5
  25. data/ext/glib2/rbglib_unichar.c +46 -5
  26. data/ext/glib2/rbglib_unicode.c +1 -18
  27. data/ext/glib2/rbglib_utils.c +1 -14
  28. data/ext/glib2/rbglib_win32.c +3 -7
  29. data/ext/glib2/rbgobj_binding.c +1 -7
  30. data/ext/glib2/rbgobj_closure.c +22 -9
  31. data/ext/glib2/rbgobj_object.c +113 -104
  32. data/ext/glib2/rbgobj_param.c +2 -8
  33. data/ext/glib2/rbgobj_paramspecs.c +6 -24
  34. data/ext/glib2/rbgobj_signal.c +81 -48
  35. data/ext/glib2/rbgobj_strv.c +2 -2
  36. data/ext/glib2/rbgobj_type.c +57 -67
  37. data/ext/glib2/rbgobj_value.c +3 -7
  38. data/ext/glib2/rbgobj_valuetypes.c +14 -62
  39. data/ext/glib2/rbgobject.c +4 -6
  40. data/ext/glib2/rbgobject.h +2 -27
  41. data/ext/glib2/rbgprivate.h +6 -6
  42. data/ext/glib2/rbgutil_callback.c +23 -26
  43. data/lib/glib2/deprecated.rb +22 -1
  44. data/lib/mkmf-gnome.rb +5 -5
  45. data/test/glib-test-utils.rb +18 -3
  46. data/test/run-test.rb +49 -15
  47. data/test/test-binding.rb +1 -11
  48. data/test/test-bytes.rb +1 -5
  49. data/test/test-date-time.rb +1 -3
  50. data/test/test-file-utils.rb +1 -32
  51. data/test/test-iochannel.rb +3 -5
  52. data/test/test-key-file.rb +5 -6
  53. data/test/test-match-info.rb +1 -5
  54. data/test/test-regex.rb +1 -5
  55. data/test/test-source.rb +1 -14
  56. data/test/test-spawn.rb +2 -1
  57. data/test/test-time-zone.rb +1 -5
  58. data/test/test-timeout.rb +2 -3
  59. data/test/test-unicode.rb +16 -12
  60. data/test/test-utils.rb +2 -8
  61. data/test/test-variant-type.rb +1 -3
  62. data/test/test-win32.rb +6 -6
  63. metadata +3 -5
  64. data/ext/glib2/rbgobj_valuearray.c +0 -100
  65. data/test/glib-test-init.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aeddfc0215ee30844546ff76736ce9cf3a5f91567370402ad9f8cf385a592df0
4
- data.tar.gz: 611e4963dbfb535436a98e95bb87a89c90b8944d189cebe622950f3dbb0ae9c0
3
+ metadata.gz: d2df97b279c5c861a8774ed873d2fccfaeefaf0009985875206e41e6645affda
4
+ data.tar.gz: 458e5179e4eef5bdba682b26efb493ff87867b6f4e69bc34d898a84bb6778639
5
5
  SHA512:
6
- metadata.gz: 9d255c68d7cabb20afb84cc8c2fd3786ee9e4f42b0d00394284fb84b1a5a171d179f7e2e2a17d668812ac23d3771e1bb731799ce4bb85860427def978f8c442b
7
- data.tar.gz: da657f1a7520dfcca25e2aee42c1f18b96e490f8d6c976827d4546e43b28767995857da5e5280786a7028b07bcdcbc11504c5cb6b018493e1793502631d8b0a5
6
+ metadata.gz: 5bed850bc19ba04a9e9197e23dabc6aa286f535afe2021a89b16f3309e3bad200cbbab65abaf63d42aba3a3a1eec0112cadb72de53617fd90e2dabc0f8a6ef35
7
+ data.tar.gz: dffb95ad1aeeb6160cb906734df2781a07ded40c7d9a43edb675c6545755f9d2325d9bacdaff3b791db5f491fc328f642221b0ad89d75c306f5cd69c3ba88161
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Ruby/GLib2
2
2
 
3
- Ruby/GLib2 is a Ruby binding of GLib-2.12.x.
3
+ Ruby/GLib2 is a Ruby binding of GLib 2.48 or later.
4
4
 
5
5
  ## Requirements
6
6
 
7
- * Ruby >= 1.9.x: https://www.ruby-lang.org/
8
- * pkg-config.rb: https://github.com/rcairo/pkg-config
9
- * GLib >= 2.12.x: https://www.gtk.org/
7
+ * Ruby >= 2.5: https://www.ruby-lang.org/
8
+ * pkg-config.rb: https://github.com/ruby-gnome/pkg-config
9
+ * GLib >= 2.48: https://www.gtk.org/
10
10
 
11
11
  ## Install
12
12
 
@@ -16,7 +16,7 @@ gem install glib2
16
16
 
17
17
  ## Copying
18
18
 
19
- Copyright (c) 2002-2019 Ruby-GNOME Project Team
19
+ Copyright (c) 2002-2021 Ruby-GNOME Project Team
20
20
 
21
21
  This program is free software.
22
22
  You can distribute/modify this program under the terms of
data/ext/glib2/extconf.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2002-2019 Ruby-GNOME Project Team
1
+ # Copyright (C) 2002-2021 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -42,10 +42,6 @@ have_header("unistd.h")
42
42
  have_header("io.h")
43
43
 
44
44
  glib_header = "glib.h"
45
- have_func("g_spawn_close_pid", glib_header)
46
- have_func("g_thread_init", glib_header)
47
- have_func("g_main_depth", glib_header)
48
- have_func("g_listenv", glib_header)
49
45
 
50
46
  ruby_header = "ruby.h"
51
47
  have_func("rb_check_array_type", ruby_header)
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2017-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2017-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,6 @@ rbg_is_bytes(VALUE object)
32
32
  return RVAL2CBOOL(rb_obj_is_kind_of(object, RG_TARGET_NAMESPACE));
33
33
  }
34
34
 
35
- #if GLIB_CHECK_VERSION(2, 32, 0)
36
35
  static VALUE RG_TARGET_NAMESPACE;
37
36
 
38
37
  static VALUE
@@ -119,12 +118,10 @@ rg_pointer(VALUE self)
119
118
 
120
119
  return ULONG2NUM((guintptr)data);
121
120
  }
122
- #endif
123
121
 
124
122
  void
125
123
  Init_glib_bytes(void)
126
124
  {
127
- #if GLIB_CHECK_VERSION(2, 32, 0)
128
125
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BYTES, "Bytes", mGLib);
129
126
 
130
127
  RG_DEF_SMETHOD(try_convert, 1);
@@ -135,5 +132,4 @@ Init_glib_bytes(void)
135
132
  RG_DEF_METHOD(size, 0);
136
133
  RG_DEF_ALIAS("length", "size");
137
134
  RG_DEF_METHOD(pointer, 0);
138
- #endif
139
135
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2018-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2018-2020 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -20,32 +20,45 @@
20
20
 
21
21
  #include "rbgprivate.h"
22
22
 
23
- static GHashTable *rbg_objects = NULL;
23
+ typedef struct {
24
+ VALUE object;
25
+ guint ref_count;
26
+ } RBGGCMarkItem;
27
+
28
+ typedef struct {
29
+ GHashTable *items;
30
+ GMutex mutex;
31
+ } RBGGCMarker;
32
+
33
+ static RBGGCMarker *rbg_gc_marker_raw = NULL;
24
34
 
25
35
  static void
26
36
  gc_marker_mark_each(G_GNUC_UNUSED gpointer key,
27
37
  gpointer value,
28
38
  G_GNUC_UNUSED gpointer user_data)
29
39
  {
30
- VALUE rb_object = (VALUE)value;
31
- rb_gc_mark(rb_object);
40
+ RBGGCMarkItem *item = value;
41
+ rb_gc_mark(item->object);
32
42
  }
33
43
 
34
44
  static void
35
45
  gc_marker_mark(void *data)
36
46
  {
37
- GHashTable *hash_table = data;
38
- g_hash_table_foreach(hash_table, gc_marker_mark_each, NULL);
47
+ RBGGCMarker *marker = data;
48
+ g_mutex_lock(&(marker->mutex));
49
+ g_hash_table_foreach(marker->items, gc_marker_mark_each, NULL);
50
+ g_mutex_unlock(&(marker->mutex));
39
51
  }
40
52
 
41
53
  static void
42
54
  gc_marker_free(void *data)
43
55
  {
44
- GHashTable *hash_table = data;
45
- g_hash_table_unref(hash_table);
46
- if (hash_table == rbg_objects) {
47
- rbg_objects = NULL;
56
+ RBGGCMarker *marker_raw = data;
57
+ if (marker_raw == rbg_gc_marker_raw) {
58
+ rbg_gc_marker_raw = NULL;
48
59
  }
60
+ g_hash_table_unref(marker_raw->items);
61
+ g_free(marker_raw);
49
62
  }
50
63
 
51
64
  static const rb_data_type_t rbg_gc_marker_type = {
@@ -59,95 +72,128 @@ static const rb_data_type_t rbg_gc_marker_type = {
59
72
  RUBY_TYPED_FREE_IMMEDIATELY,
60
73
  };
61
74
 
62
- void
63
- rbg_gc_guard(gpointer key, VALUE rb_object)
75
+ static VALUE
76
+ rbg_gc_marker_new_raw(void)
64
77
  {
65
- if (!rbg_objects)
66
- return;
78
+ RBGGCMarker *gc_marker_raw = g_new(RBGGCMarker, 1);
79
+ gc_marker_raw->items = g_hash_table_new_full(g_direct_hash,
80
+ g_direct_equal,
81
+ NULL,
82
+ g_free);
83
+ g_mutex_init(&(gc_marker_raw->mutex));
84
+
85
+ return TypedData_Wrap_Struct(rb_cObject,
86
+ &rbg_gc_marker_type,
87
+ gc_marker_raw);
88
+ }
89
+
90
+ static void
91
+ rbg_gc_guard_raw(RBGGCMarker *gc_marker, gpointer key, VALUE rb_object)
92
+ {
93
+ g_mutex_lock(&(gc_marker->mutex));
94
+ RBGGCMarkItem *item = g_hash_table_lookup(gc_marker->items, key);
95
+ if (item) {
96
+ item->ref_count++;
97
+ } else {
98
+ item = g_new(RBGGCMarkItem, 1);
99
+ item->object = rb_object;
100
+ item->ref_count = 1;
101
+ g_hash_table_insert(gc_marker->items, key, item);
102
+ }
103
+ g_mutex_unlock(&(gc_marker->mutex));
104
+ }
67
105
 
68
- g_hash_table_insert(rbg_objects,
69
- key,
70
- (gpointer)rb_object);
106
+ static void
107
+ rbg_gc_unguard_raw(RBGGCMarker *gc_marker, gpointer key)
108
+ {
109
+ g_mutex_lock(&(gc_marker->mutex));
110
+ RBGGCMarkItem *item = g_hash_table_lookup(gc_marker->items, key);
111
+ if (item) {
112
+ item->ref_count--;
113
+ if (item->ref_count == 0) {
114
+ g_hash_table_remove(gc_marker->items, key);
115
+ }
116
+ }
117
+ g_mutex_unlock(&(gc_marker->mutex));
118
+ }
119
+
120
+ static void
121
+ rbg_gc_unguard_all_raw(RBGGCMarker *gc_marker)
122
+ {
123
+ g_mutex_lock(&(gc_marker->mutex));
124
+ g_hash_table_remove_all(gc_marker->items);
125
+ g_mutex_unlock(&(gc_marker->mutex));
71
126
  }
72
127
 
73
128
  void
74
- rbg_gc_unguard(gpointer key)
129
+ rbg_gc_guard(gpointer key, VALUE rb_object)
75
130
  {
76
- if (!rbg_objects)
131
+ if (!rbg_gc_marker_raw)
77
132
  return;
78
133
 
79
- g_hash_table_remove(rbg_objects, key);
134
+ rbg_gc_guard_raw(rbg_gc_marker_raw, key, rb_object);
80
135
  }
81
136
 
82
- static VALUE
83
- rbg_gc_marker_new_raw(GHashTable *rb_objects)
137
+ void
138
+ rbg_gc_unguard(gpointer key)
84
139
  {
85
- VALUE gc_marker;
140
+ if (!rbg_gc_marker_raw)
141
+ return;
86
142
 
87
- gc_marker = TypedData_Wrap_Struct(rb_cData,
88
- &rbg_gc_marker_type,
89
- rb_objects);
90
- return gc_marker;
143
+ rbg_gc_unguard_raw(rbg_gc_marker_raw, key);
91
144
  }
92
145
 
93
146
  VALUE
94
147
  rbg_gc_marker_new(void)
95
148
  {
96
- GHashTable *rb_objects;
97
-
98
- rb_objects = g_hash_table_new(g_direct_hash, g_direct_equal);
99
- return rbg_gc_marker_new_raw(rb_objects);
149
+ return rbg_gc_marker_new_raw();
100
150
  }
101
151
 
102
152
  void
103
153
  rbg_gc_marker_guard(VALUE rb_gc_marker, VALUE rb_object)
104
154
  {
105
- GHashTable *rb_objects;
106
-
155
+ RBGGCMarker *gc_marker;
107
156
  TypedData_Get_Struct(rb_gc_marker,
108
- GHashTable,
157
+ RBGGCMarker,
109
158
  &rbg_gc_marker_type,
110
- rb_objects);
111
- g_hash_table_insert(rb_objects,
112
- (gpointer)rb_object,
113
- (gpointer)rb_object);
159
+ gc_marker);
160
+ rbg_gc_guard_raw(gc_marker, RVAL2POINTER(rb_object), rb_object);
114
161
  }
115
162
 
116
163
  void
117
164
  rbg_gc_marker_unguard(VALUE rb_gc_marker, VALUE rb_object)
118
165
  {
119
- GHashTable *rb_objects;
120
-
121
166
  if (!RB_TYPE_P(rb_gc_marker, RUBY_T_DATA))
122
167
  return;
123
168
  if (!RTYPEDDATA_P(rb_gc_marker))
124
169
  return;
125
170
 
171
+ RBGGCMarker *gc_marker;
126
172
  TypedData_Get_Struct(rb_gc_marker,
127
- GHashTable,
173
+ RBGGCMarker,
128
174
  &rbg_gc_marker_type,
129
- rb_objects);
130
- g_hash_table_remove(rb_objects, (gpointer)rb_object);
175
+ gc_marker);
176
+ rbg_gc_unguard_raw(gc_marker, RVAL2POINTER(rb_object));
131
177
  }
132
178
 
133
179
  void
134
180
  rbg_gc_marker_unguard_all(VALUE rb_gc_marker)
135
181
  {
136
- GHashTable *rb_objects;
137
-
182
+ RBGGCMarker *gc_marker;
138
183
  TypedData_Get_Struct(rb_gc_marker,
139
- GHashTable,
184
+ RBGGCMarker,
140
185
  &rbg_gc_marker_type,
141
- rb_objects);
142
- g_hash_table_remove_all(rb_objects);
186
+ gc_marker);
187
+ rbg_gc_unguard_all_raw(gc_marker);
143
188
  }
144
189
 
145
190
  void
146
191
  Init_glib_gc(void)
147
192
  {
148
- VALUE gc_marker;
149
-
150
- rbg_objects = g_hash_table_new(g_direct_hash, g_direct_equal);
151
- gc_marker = rbg_gc_marker_new_raw(rbg_objects);
193
+ VALUE gc_marker = rbg_gc_marker_new_raw();
152
194
  rb_ivar_set(mGLib, rb_intern("gc_marker"), gc_marker);
195
+ TypedData_Get_Struct(gc_marker,
196
+ RBGGCMarker,
197
+ &rbg_gc_marker_type,
198
+ rbg_gc_marker_raw);
153
199
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2016 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -303,14 +303,10 @@ Init_glib_variant_type(void)
303
303
  DEF_TYPE(DICT_ENTRY);
304
304
  DEF_TYPE(DICTIONARY);
305
305
  DEF_TYPE(STRING_ARRAY);
306
- # if GLIB_CHECK_VERSION(2, 30, 0)
307
306
  DEF_TYPE(OBJECT_PATH_ARRAY);
308
- # endif
309
307
  DEF_TYPE(BYTESTRING);
310
308
  DEF_TYPE(BYTESTRING_ARRAY);
311
- # if GLIB_CHECK_VERSION(2, 30, 0)
312
309
  DEF_TYPE(VARDICT);
313
- # endif
314
310
 
315
311
  #undef DEF_TYPE
316
312
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2016 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -22,7 +22,7 @@
22
22
 
23
23
  #define RG_TARGET_NAMESPACE cVariant
24
24
 
25
- #define _SELF(s) (DATA_PTR(s))
25
+ #define _SELF(s) (RTYPEDDATA_DATA(s))
26
26
 
27
27
  static VALUE RG_TARGET_NAMESPACE;
28
28
 
@@ -191,7 +191,6 @@ rg_ruby_to_variant(VALUE rb_value, VALUE rb_variant_type)
191
191
  }
192
192
  }
193
193
  return g_variant_new_strv(strings, length);
194
- #if GLIB_CHECK_VERSION(2, 30, 0)
195
194
  } else if (g_variant_type_equal(variant_type,
196
195
  G_VARIANT_TYPE_OBJECT_PATH_ARRAY)) {
197
196
  const gchar **paths;
@@ -210,7 +209,6 @@ rg_ruby_to_variant(VALUE rb_value, VALUE rb_variant_type)
210
209
  }
211
210
  }
212
211
  return g_variant_new_objv(paths, length);
213
- #endif
214
212
  } else if (g_variant_type_equal(variant_type, G_VARIANT_TYPE_ARRAY)) {
215
213
  int i;
216
214
  GVariantBuilder builder;
@@ -259,7 +257,7 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
259
257
  rb_scan_args(argc, argv, "11", &rb_value, &rb_variant_type);
260
258
  variant = rg_ruby_to_variant(rb_value, rb_variant_type);
261
259
  g_variant_ref_sink(variant);
262
- DATA_PTR(self) = variant;
260
+ RTYPEDDATA_DATA(self) = variant;
263
261
 
264
262
  return Qnil;
265
263
  }
data/ext/glib2/rbglib.c CHANGED
@@ -1072,6 +1072,10 @@ extern void Init_glib2(void);
1072
1072
  void
1073
1073
  Init_glib2(void)
1074
1074
  {
1075
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
1076
+ rb_ext_ractor_safe(true);
1077
+ #endif
1078
+
1075
1079
  const gchar **filename_charsets;
1076
1080
 
1077
1081
  id_inspect = rb_intern("inspect");
data/ext/glib2/rbglib.h CHANGED
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
33
33
 
34
34
  #define RBGLIB_MAJOR_VERSION 3
35
35
  #define RBGLIB_MINOR_VERSION 4
36
- #define RBGLIB_MICRO_VERSION 3
36
+ #define RBGLIB_MICRO_VERSION 4
37
37
 
38
38
  #ifndef RB_ZALLOC
39
39
  # ifdef ZALLOC
@@ -139,6 +139,9 @@ G_BEGIN_DECLS
139
139
  #define RVAL2GUINT32S(ary, n) rbg_rval2guint32s(&(ary), &(n))
140
140
  #define RVAL2GDOUBLES(ary, n) rbg_rval2gdoubles(&(ary), &(n))
141
141
 
142
+ #define RVAL2POINTER(value) ((gpointer)(value))
143
+ #define POINTER2RVAL(pointer) ((VALUE)(pointer))
144
+
142
145
  #define GINTS2RVAL(ary, n) rbg_gints2rval(ary, n)
143
146
  #define GINTS2RVAL_FREE(ary, n) rbg_gints2rval(ary, n)
144
147
 
@@ -385,7 +385,7 @@ rg_set_groups(VALUE self, VALUE rburi, VALUE rbgroups)
385
385
  long n;
386
386
  gchar **groups = RVAL2STRS(rbgroups, n);
387
387
 
388
- g_bookmark_file_set_groups(bookmark, uri, groups, n);
388
+ g_bookmark_file_set_groups(bookmark, uri, (const gchar **)groups, n);
389
389
 
390
390
  g_free(groups);
391
391
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (C) 2016 Ruby-GNOME2 Project Team
2
+ * Copyright (C) 2016-2021 Ruby-GNOME Project Team
3
3
  *
4
4
  * This library is free software; you can redistribute it and/or
5
5
  * modify it under the terms of the GNU Lesser General Public
@@ -69,10 +69,8 @@ rg_s_now(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
69
69
  date = g_date_time_new_now_local();
70
70
  } else if (is_utc_timezone(rb_timezone)) {
71
71
  date = g_date_time_new_now_utc();
72
- #if GLIB_CHECK_VERSION(2, 34, 0)
73
72
  } else if (is_timezone(rb_timezone)) {
74
73
  date = g_date_time_new_now(RVAL2GTIMEZONE(rb_timezone));
75
- #endif
76
74
  } else {
77
75
  rb_raise(rb_eArgError,
78
76
  "timezone must be nil, :local, :utc or GLib::TimeZone: "
@@ -160,7 +158,6 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
160
158
  hour,
161
159
  minute,
162
160
  second);
163
- #if GLIB_CHECK_VERSION(2, 34, 0)
164
161
  } else if (is_timezone(rb_timezone)) {
165
162
  GTimeZone *timezone = NULL;
166
163
 
@@ -172,7 +169,6 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
172
169
  hour,
173
170
  minute,
174
171
  second);
175
- #endif
176
172
  } else {
177
173
  rb_raise(rb_eArgError,
178
174
  ":timezone must be nil, :local, :utc or GLib::TimeZone: "