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
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2005 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -23,32 +23,6 @@
23
23
 
24
24
  static ID id_call;
25
25
 
26
- /*****************************************/
27
- #if !GLIB_CHECK_VERSION(2,30,0)
28
- static void
29
- source_free(GSource *source)
30
- {
31
- if (g_source_is_destroyed(source)) {
32
- return;
33
- }
34
-
35
- g_source_unref(source);
36
- g_source_destroy(source);
37
- }
38
-
39
- GType
40
- g_source_get_type(void)
41
- {
42
- static GType our_type = 0;
43
- if (our_type == 0)
44
- our_type = g_boxed_type_register_static ("GSource",
45
- (GBoxedCopyFunc)g_source_ref,
46
- (GBoxedFreeFunc)source_free);
47
- return our_type;
48
- }
49
- #endif
50
- /*****************************************/
51
-
52
26
  #define RG_TARGET_NAMESPACE cSource
53
27
  #define _SELF(s) ((GSource*)RVAL2BOXED(s, G_TYPE_SOURCE))
54
28
 
@@ -112,7 +86,6 @@ rg_id(VALUE self)
112
86
  return UINT2NUM(g_source_get_id(_SELF(self)));
113
87
  }
114
88
 
115
- #if GLIB_CHECK_VERSION(2, 26, 0)
116
89
  static VALUE
117
90
  rg_name(VALUE self)
118
91
  {
@@ -125,7 +98,6 @@ rg_set_name(VALUE self, VALUE name)
125
98
  g_source_set_name(_SELF(self), RVAL2CSTR(name));
126
99
  return self;
127
100
  }
128
- #endif
129
101
 
130
102
  static VALUE
131
103
  rg_context(VALUE self)
@@ -158,7 +130,6 @@ void g_source_set_callback_indirect (GSource *source,
158
130
  GSourceCallbackFuncs *callback_funcs);
159
131
  */
160
132
 
161
- #if GLIB_CHECK_VERSION(2, 36, 0)
162
133
  static VALUE
163
134
  rg_ready_time(VALUE self)
164
135
  {
@@ -173,7 +144,6 @@ rg_set_ready_time(VALUE self, VALUE ready_time)
173
144
  g_source_set_ready_time(_SELF(self), NUM2LL(ready_time));
174
145
  return self;
175
146
  }
176
- #endif
177
147
 
178
148
  static VALUE
179
149
  rg_add_poll(VALUE self, VALUE fd)
@@ -189,7 +159,6 @@ rg_remove_poll(VALUE self, VALUE fd)
189
159
  return self;
190
160
  }
191
161
 
192
- #if GLIB_CHECK_VERSION(2, 28, 0)
193
162
  static VALUE
194
163
  rg_time(VALUE self)
195
164
  {
@@ -197,7 +166,6 @@ rg_time(VALUE self)
197
166
  time = g_source_get_time(_SELF(self));
198
167
  return LL2NUM(time);
199
168
  }
200
- #endif
201
169
 
202
170
  /* How can I implement them ?
203
171
  gboolean g_source_remove_by_funcs_user_data
@@ -226,21 +194,15 @@ Init_glib_source(void)
226
194
  RG_DEF_METHOD(set_can_recurse, 1);
227
195
  RG_DEF_METHOD_P(can_recurse, 0);
228
196
  RG_DEF_METHOD(id, 0);
229
- #if GLIB_CHECK_VERSION(2, 26, 0)
230
197
  RG_DEF_METHOD(name, 0);
231
198
  RG_REPLACE_SET_PROPERTY(name, 1);
232
- #endif
233
199
  RG_DEF_METHOD(context, 0);
234
200
  RG_DEF_METHOD(set_callback, 0);
235
- #if GLIB_CHECK_VERSION(2, 36, 0)
236
201
  RG_DEF_METHOD(ready_time, 0);
237
202
  RG_REPLACE_SET_PROPERTY(ready_time, 1);
238
- #endif
239
203
  RG_DEF_METHOD(add_poll, 1);
240
204
  RG_DEF_METHOD(remove_poll, 1);
241
- #if GLIB_CHECK_VERSION(2, 28, 0)
242
205
  RG_DEF_METHOD(time, 0);
243
- #endif
244
206
 
245
207
  /* GLib::Source.remove is moved to rbglib_maincontext.c */
246
208
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2004 Masao Mutoh
5
5
  * Copyright (C) 2004 Kazuhiro NISHIYAMA
6
6
  *
@@ -29,10 +29,11 @@ static ID id_call;
29
29
  static ID id_new;
30
30
 
31
31
  static void
32
- child_setup(gpointer func)
32
+ child_setup(gpointer data)
33
33
  {
34
- if (! NIL_P(func)){
35
- rb_funcall((VALUE)func, id_call, 0);
34
+ VALUE func = POINTER2RVAL(data);
35
+ if (!NIL_P(func)) {
36
+ rb_funcall(func, id_call, 0);
36
37
  }
37
38
  }
38
39
 
@@ -204,8 +205,6 @@ rg_s_command_line_async(G_GNUC_UNUSED VALUE self, VALUE str)
204
205
  return ret;
205
206
  }
206
207
 
207
- #ifdef HAVE_G_SPAWN_CLOSE_PID
208
-
209
208
  #define RVAL2GPID(value) ((GPid)NUM2INT(pid))
210
209
 
211
210
  static VALUE
@@ -215,8 +214,6 @@ rg_s_close_pid(G_GNUC_UNUSED VALUE self, VALUE pid)
215
214
  return Qnil;
216
215
  }
217
216
 
218
- #endif
219
-
220
217
  void
221
218
  Init_glib_spawn(void)
222
219
  {
@@ -231,9 +228,7 @@ Init_glib_spawn(void)
231
228
  RG_DEF_SMETHOD(sync, 4);
232
229
  RG_DEF_SMETHOD(command_line_sync, 1);
233
230
  RG_DEF_SMETHOD(command_line_async, 1);
234
- #ifdef HAVE_G_SPAWN_CLOSE_PID
235
231
  RG_DEF_SMETHOD(close_pid, 1);
236
- #endif
237
232
 
238
233
  rb_define_const(RG_TARGET_NAMESPACE, "LEAVE_DESCRIPTORS_OPEN", INT2NUM(G_SPAWN_LEAVE_DESCRIPTORS_OPEN));
239
234
  rb_define_const(RG_TARGET_NAMESPACE, "DO_NOT_REAP_CHILD", INT2NUM(G_SPAWN_DO_NOT_REAP_CHILD));
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2004 Masao Mutoh
5
5
  * Copyright (C) 2004 Kazuhiro NISHIYAMA
6
6
  *
@@ -35,7 +35,7 @@ Init_glib_spawnerror(void)
35
35
  rb_define_const(RG_TARGET_NAMESPACE, "CHDIR", INT2NUM(G_SPAWN_ERROR_CHDIR));
36
36
  rb_define_const(RG_TARGET_NAMESPACE, "EACCES", INT2NUM(G_SPAWN_ERROR_ACCES));
37
37
  rb_define_const(RG_TARGET_NAMESPACE, "EPERM", INT2NUM(G_SPAWN_ERROR_PERM));
38
- rb_define_const(RG_TARGET_NAMESPACE, "E2BIG", INT2NUM(G_SPAWN_ERROR_2BIG));
38
+ rb_define_const(RG_TARGET_NAMESPACE, "TOO_BIG", INT2NUM(G_SPAWN_ERROR_TOO_BIG));
39
39
  rb_define_const(RG_TARGET_NAMESPACE, "ENOEXEC", INT2NUM(G_SPAWN_ERROR_NOEXEC));
40
40
  rb_define_const(RG_TARGET_NAMESPACE, "ENAMETOOLONG", INT2NUM(G_SPAWN_ERROR_NAMETOOLONG));
41
41
  rb_define_const(RG_TARGET_NAMESPACE, "ENOENT", INT2NUM(G_SPAWN_ERROR_NOENT));
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2005 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -28,26 +28,13 @@ static VALUE RG_TARGET_NAMESPACE;
28
28
  static VALUE
29
29
  rg_s_init(VALUE self)
30
30
  {
31
- #ifdef HAVE_G_THREAD_INIT
32
- #if defined(G_THREADS_ENABLED) && !GLIB_CHECK_VERSION(2, 32, 0)
33
- g_thread_init(NULL);
34
- #endif
35
- #endif
36
31
  return self;
37
32
  }
38
33
 
39
34
  static VALUE
40
35
  rg_s_supported_p(G_GNUC_UNUSED VALUE self)
41
36
  {
42
- #ifdef HAVE_G_THREAD_INIT
43
- #ifdef G_THREADS_ENABLED
44
- return CBOOL2RVAL(g_thread_supported());
45
- #else
46
- return Qfalse;
47
- #endif
48
- #else
49
- return Qfalse;
50
- #endif
37
+ return Qtrue;
51
38
 
52
39
  }
53
40
 
@@ -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
@@ -22,7 +22,6 @@
22
22
  #define RG_TARGET_NAMESPACE cTimeZone
23
23
  #define _SELF(s) ((GTimeZone*)RVAL2BOXED(s, G_TYPE_TIME_ZONE))
24
24
 
25
- #if GLIB_CHECK_VERSION(2, 34, 0)
26
25
  static VALUE
27
26
  rg_initialize(gint argc, VALUE *argv, VALUE self)
28
27
  {
@@ -69,12 +68,10 @@ rg_offset(VALUE self, VALUE rb_interval)
69
68
  gint interval = NUM2INT(rb_interval);
70
69
  return INT2NUM(g_time_zone_get_offset(_SELF(self), interval));
71
70
  }
72
- #endif
73
71
 
74
72
  void
75
73
  Init_glib_time_zone(void)
76
74
  {
77
- #if GLIB_CHECK_VERSION(2, 34, 0)
78
75
  VALUE RG_TARGET_NAMESPACE;
79
76
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TIME_ZONE, "TimeZone", mGLib);
80
77
  RG_DEF_METHOD(initialize, -1);
@@ -82,5 +79,4 @@ Init_glib_time_zone(void)
82
79
  RG_DEF_SMETHOD(utc, 0);
83
80
  RG_DEF_METHOD(abbreviation, 1);
84
81
  RG_DEF_METHOD(offset, 1);
85
- #endif
86
82
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2006 Kouhei Sutou
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -105,7 +105,6 @@ rg_s_get_mirror_char(G_GNUC_UNUSED VALUE self, VALUE unichar)
105
105
  }
106
106
  }
107
107
 
108
- #if GLIB_CHECK_VERSION(2,14,0)
109
108
  static VALUE
110
109
  rg_s_combining_class(G_GNUC_UNUSED VALUE self, VALUE unichar)
111
110
  {
@@ -130,7 +129,6 @@ rg_s_zero_width_p(G_GNUC_UNUSED VALUE self, VALUE unichar)
130
129
  {
131
130
  return CBOOL2RVAL(g_unichar_iszerowidth(NUM2UINT(unichar)));
132
131
  }
133
- #endif
134
132
 
135
133
  static VALUE
136
134
  rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE unichar)
@@ -142,6 +140,48 @@ rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE unichar)
142
140
  return CSTR2RVAL_LEN(utf8, len);
143
141
  }
144
142
 
143
+ static VALUE
144
+ rg_s_compose(G_GNUC_UNUSED VALUE self, VALUE unichar1, VALUE unichar2)
145
+ {
146
+ gunichar composed_char;
147
+ if (g_unichar_compose(NUM2UINT(unichar1),
148
+ NUM2UINT(unichar2),
149
+ &composed_char)) {
150
+ return UINT2NUM(composed_char);
151
+ } else {
152
+ return Qnil;
153
+ }
154
+ }
155
+
156
+ static VALUE
157
+ rg_s_decompose(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
158
+ {
159
+ VALUE unichar;
160
+ VALUE options = Qnil;
161
+ gboolean compat = FALSE;
162
+
163
+ rb_scan_args(argc, argv, "1:", &unichar, &options);
164
+ if (!NIL_P(options)) {
165
+ ID keywords[1];
166
+ VALUE values[1];
167
+ keywords[0] = rb_intern("compat");
168
+ rb_get_kwargs(options, keywords, 0, 1, values);
169
+ if (values[0] != Qundef) {
170
+ compat = CBOOL2RVAL(values[0]);
171
+ }
172
+ }
173
+
174
+ /* 18 is enough. See g_unichar_fully_decompose() document. */
175
+ gunichar result[G_UNICHAR_MAX_DECOMPOSITION_LENGTH];
176
+ gsize result_len =
177
+ g_unichar_fully_decompose(NUM2UINT(unichar),
178
+ compat,
179
+ result,
180
+ G_UNICHAR_MAX_DECOMPOSITION_LENGTH);
181
+ return CSTR2RVAL_LEN_UCS4((const char *)result,
182
+ result_len * sizeof(gunichar));
183
+ }
184
+
145
185
  void
146
186
  Init_glib_unichar(void)
147
187
  {
@@ -190,12 +230,13 @@ Init_glib_unichar(void)
190
230
 
191
231
  RG_DEF_SMETHOD(get_mirror_char, 1);
192
232
 
193
- #if GLIB_CHECK_VERSION(2,14,0)
194
233
  RG_DEF_SMETHOD(combining_class, 1);
195
234
  RG_DEF_SMETHOD(get_script, 1);
196
235
  RG_DEF_SMETHOD_P(mark, 1);
197
236
  RG_DEF_SMETHOD_P(zero_width, 1);
198
- #endif
199
237
 
200
238
  RG_DEF_SMETHOD(to_utf8, 1);
239
+
240
+ RG_DEF_SMETHOD(compose, 2);
241
+ RG_DEF_SMETHOD(decompose, -1);
201
242
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011-2019 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2021 Ruby-GNOME Project Team
4
4
  * Copyright (C) 2006 Kouhei Sutou
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -49,20 +49,6 @@ rg_s_canonical_ordering(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4)
49
49
  return normalized_ucs4;
50
50
  }
51
51
 
52
- static VALUE
53
- rg_s_canonical_decomposition(G_GNUC_UNUSED VALUE self, VALUE unichar)
54
- {
55
- VALUE normalized_ucs4;
56
- gunichar *ucs4;
57
- gsize len;
58
-
59
- ucs4 = g_unicode_canonical_decomposition(NUM2UINT(unichar), &len);
60
- normalized_ucs4 = CSTR2RVAL_LEN_UCS4((const char *)ucs4,
61
- len * sizeof(gunichar));
62
- g_free(ucs4);
63
- return normalized_ucs4;
64
- }
65
-
66
52
  void
67
53
  Init_glib_unicode(void)
68
54
  {
@@ -75,16 +61,13 @@ Init_glib_unicode(void)
75
61
  G_DEF_CLASS(G_TYPE_UNICODE_BREAK_TYPE, "BreakType", RG_TARGET_NAMESPACE);
76
62
  G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNICODE_BREAK_TYPE, "G_UNICODE_");
77
63
 
78
- #if GLIB_CHECK_VERSION(2,14,0)
79
64
  /* GUnicodeScript */
80
65
  G_DEF_CLASS(G_TYPE_UNICODE_SCRIPT, "Script", RG_TARGET_NAMESPACE);
81
66
  G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNICODE_SCRIPT, "G_UNICODE_");
82
- #endif
83
67
 
84
68
  G_DEF_CLASS(G_TYPE_NORMALIZE_MODE, "NormalizeMode", mGLib);
85
69
 
86
70
  rbg_define_singleton_method(mGLib, "charset", rbglib_m_charset, 0);
87
71
 
88
72
  RG_DEF_SMETHOD(canonical_ordering, 1);
89
- RG_DEF_SMETHOD(canonical_decomposition, 1);
90
73
  }
@@ -1,7 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011-2019 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2004 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2004-2021 Ruby-GNOME Project Team
5
4
  * Copyright (C) 2004 Pascal Terjan
6
5
  *
7
6
  * This library is free software; you can redistribute it and/or
@@ -71,7 +70,6 @@ rg_s_unsetenv(VALUE self, VALUE variable)
71
70
  return self;
72
71
  }
73
72
 
74
- #ifdef HAVE_G_LISTENV
75
73
  static VALUE
76
74
  rg_s_listenv(G_GNUC_UNUSED VALUE self)
77
75
  {
@@ -86,7 +84,6 @@ rg_s_listenv(G_GNUC_UNUSED VALUE self)
86
84
  g_strfreev(c_list);
87
85
  return r_list;
88
86
  }
89
- #endif
90
87
 
91
88
  static VALUE
92
89
  rg_s_host_name(G_GNUC_UNUSED VALUE self)
@@ -136,14 +133,12 @@ rg_s_system_config_dirs(G_GNUC_UNUSED VALUE self)
136
133
  return STRV2RVAL((const gchar **)g_get_system_config_dirs());
137
134
  }
138
135
 
139
- #if GLIB_CHECK_VERSION(2, 14, 0)
140
136
  static VALUE
141
137
  rg_s_get_user_special_dir(G_GNUC_UNUSED VALUE self, VALUE directory)
142
138
  {
143
139
  return CSTR2RVAL(g_get_user_special_dir(RVAL2GENUM(directory,
144
140
  G_TYPE_USER_DIRECTORY)));
145
141
  }
146
- #endif
147
142
 
148
143
  static VALUE
149
144
  rg_s_home_dir(G_GNUC_UNUSED VALUE self)
@@ -288,15 +283,11 @@ void
288
283
  Init_glib_utils(void)
289
284
  {
290
285
  /* glib/gutils.h */
291
- #if GLIB_CHECK_VERSION(2, 14, 0)
292
286
  G_DEF_CLASS(G_TYPE_USER_DIRECTORY, "UserDirectory", RG_TARGET_NAMESPACE);
293
287
  G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_USER_DIRECTORY, "G_");
294
- #endif
295
288
 
296
- #if GLIB_CHECK_VERSION(2, 30, 0)
297
289
  G_DEF_CLASS(G_TYPE_FORMAT_SIZE_FLAGS,
298
290
  "FormatSizeFlags", RG_TARGET_NAMESPACE);
299
- #endif
300
291
 
301
292
  RG_DEF_SMETHOD(application_name, 0);
302
293
  RG_DEF_SMETHOD(set_application_name, 1);
@@ -305,9 +296,7 @@ Init_glib_utils(void)
305
296
  RG_DEF_SMETHOD(getenv, 1);
306
297
  RG_DEF_SMETHOD(setenv, 2);
307
298
  RG_DEF_SMETHOD(unsetenv, 1);
308
- #ifdef HAVE_G_LISTENV
309
299
  RG_DEF_SMETHOD(listenv, 0);
310
- #endif
311
300
  RG_DEF_SMETHOD(host_name, 0);
312
301
  RG_DEF_SMETHOD(user_name, 0);
313
302
  RG_DEF_SMETHOD(real_name, 0);
@@ -317,9 +306,7 @@ Init_glib_utils(void)
317
306
  RG_DEF_SMETHOD(user_config_dir, 0);
318
307
  RG_DEF_SMETHOD(system_data_dirs, 0);
319
308
  RG_DEF_SMETHOD(system_config_dirs, 0);
320
- #if GLIB_CHECK_VERSION(2, 14, 0)
321
309
  RG_DEF_SMETHOD(get_user_special_dir, 1);
322
- #endif
323
310
  RG_DEF_SMETHOD(home_dir, 0);
324
311
  RG_DEF_SMETHOD(tmp_dir, 0);
325
312
  RG_DEF_SMETHOD(current_dir, 0);