Drop redundant glib version checks
authorMatthias Clasen <mclasen@redhat.com>
Thu, 17 Nov 2022 19:16:37 +0000 (14:16 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 03:49:56 +0000 (22:49 -0500)
We require GLib 2.72 now.

12 files changed:
gdk/broadway/broadway-server.c
gdk/broadway/gdksurface-broadway.c
gdk/gdkprivate.h
modules/printbackends/gtkprintbackendcups.c
testsuite/gtk/calendar.c
testsuite/gtk/flattenlistmodel.c
testsuite/gtk/multiselection.c
testsuite/gtk/slicelistmodel.c
testsuite/gtk/sortlistmodel.c
testsuite/gtk/timsort.c
testsuite/reftests/gtk-reftest.c
tools/updateiconcache.c

index b90c849f94e1d998626cba773ef2d440bc1d42f4..37b1eb23f5996566b5c02d46dddf212cb7807fb1 100644 (file)
 #include <string.h>
 #endif
 
-#if !GLIB_CHECK_VERSION (2, 67, 3)
-# define g_memdup2(mem,size)    g_memdup((mem), (size))
-#endif
-
 typedef struct {
   int id;
   guint32 tag;
index a29b5f26016cbd56fc9dfe4d27dcf7a47d7ed95f..9dc5bb8e7f63081550465c162efc5bb362ce70c3 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
-#if !GLIB_CHECK_VERSION (2, 67, 3)
-# define g_memdup2(mem,size)    g_memdup((mem), (size))
-#endif
-
 /* Forward declarations */
 static void        gdk_broadway_surface_finalize   (GObject            *object);
 
index c2174875e61a842f742c4437a6de1496e2f36b5f..0f37cb0d8bbcfd4359f6001f85a9415c88a98cf3 100644 (file)
@@ -16,21 +16,9 @@ PangoDirection gdk_unichar_direction (gunichar    ch) G_GNUC_CONST;
 PangoDirection gdk_find_base_dir     (const char *text,
                                       int         len);
 
-/* Backward compatibility shim, to avoid bumping up the minimum
- * required version of GLib; most of our uses of g_memdup() are
- * safe, and those that aren't have been fixed
- */
-#if !GLIB_CHECK_VERSION (2, 67, 3)
-# define g_memdup2(mem,size)    g_memdup((mem),(size))
-#endif
-
 void gdk_source_set_static_name_by_id (guint       tag,
                                        const char *name);
 
-#if !GLIB_CHECK_VERSION(2, 69, 1)
-#define g_source_set_static_name(source, name) g_source_set_name ((source), (name))
-#endif
-
 #ifndef I_
 #define I_(string) g_intern_static_string (string)
 #endif
index e0398bb1d4eacc7c55797584a99082ad64a4451b..878e073741115427b6081554dc000e06a9c04802 100644 (file)
@@ -89,10 +89,6 @@ typedef struct _GtkPrintBackendCupsClass GtkPrintBackendCupsClass;
 #define _CUPS_MAP_ATTR_INT(attr, v, a) {if (!g_ascii_strcasecmp (attr->name, (a))) v = attr->values[0].integer;}
 #define _CUPS_MAP_ATTR_STR(attr, v, a) {if (!g_ascii_strcasecmp (attr->name, (a))) v = attr->values[0].string.text;}
 
-#if !GLIB_CHECK_VERSION (2, 67, 3)
-# define g_memdup2(mem,size)    g_memdup((mem), (size))
-#endif
-
 typedef void (* GtkPrintCupsResponseCallbackFunc) (GtkPrintBackend *print_backend,
                                                    GtkCupsResult   *result,
                                                    gpointer         user_data);
index c513f56c410df0627bf42c2a2115f03578fd2c90..4e76c71b5cedd603fc9c55c27dcdf180784b82db 100644 (file)
@@ -10,11 +10,7 @@ test_calendar_set_day (void)
 
   cal = gtk_calendar_new ();
 
-#if GLIB_CHECK_VERSION(2,68,0)
   tz = g_time_zone_new_identifier ("MET");
-#else
-  tz = g_time_zone_new ("MET");
-#endif
   g_assert_nonnull (tz);
   dt = g_date_time_new (tz, 1970, 3, 1, 0, 0, 0);
   g_assert_nonnull (dt);
index 4a310956fdffe30adf80c0f90616639feefce160..ac9d7891b59f83487c6f2fce9228e32345a38903 100644 (file)
@@ -415,12 +415,10 @@ main (int argc, char *argv[])
   g_test_add_func ("/flattenlistmodel/create_empty", test_create_empty);
   g_test_add_func ("/flattenlistmodel/create", test_create);
   g_test_add_func ("/flattenlistmodel/model/add", test_model_add);
-#if GLIB_CHECK_VERSION (2, 58, 0) /* g_list_store_splice() is broken before 2.58 */
   g_test_add_func ("/flattenlistmodel/submodel/add", test_submodel_add);
   g_test_add_func ("/flattenlistmodel/submodel/add2", test_submodel_add2);
   g_test_add_func ("/flattenlistmodel/model/remove", test_model_remove);
   g_test_add_func ("/flattenlistmodel/submodel/remove", test_submodel_remove);
-#endif
 
   return g_test_run ();
 }
index 5825ede9ac4fd2da7866bb217c2ae532af23faf3..270cddd63eaf508aa525528d623aef8a0710dc1e 100644 (file)
@@ -745,9 +745,7 @@ main (int argc, char *argv[])
 
   g_test_add_func ("/multiselection/create", test_create);
   g_test_add_func ("/multiselection/create-empty", test_create_empty);
-#if GLIB_CHECK_VERSION (2, 58, 0) /* g_list_store_splice() is broken before 2.58 */
   g_test_add_func ("/multiselection/changes", test_changes);
-#endif
   g_test_add_func ("/multiselection/selection", test_selection);
   g_test_add_func ("/multiselection/select-range", test_select_range);
   g_test_add_func ("/multiselection/readd", test_readd);
index 84a4ac72baec6b0393f0be5dacba2f120b2a0ce0..0c4cd7e78dbd830adb28b7e1d7b45b2f2ca51c60 100644 (file)
@@ -389,9 +389,7 @@ main (int argc, char *argv[])
   g_test_add_func ("/slicelistmodel/create", test_create);
   g_test_add_func ("/slicelistmodel/set-model", test_set_model);
   g_test_add_func ("/slicelistmodel/set-slice", test_set_slice);
-#if GLIB_CHECK_VERSION (2, 58, 0) /* g_list_store_splice() is broken before 2.58 */
   g_test_add_func ("/slicelistmodel/changes", test_changes);
-#endif
   g_test_add_func ("/slicelistmodel/bug/added_equals_removed", test_bug_added_equals_removed);
   g_test_add_func ("/slicelistmodel/bug/skip_amount", test_bug_skip_amount);
 
index 11da526f5abb65c2532fa2376f4bcb4615074e1c..6a1753373c845357c978caeac180ef25f8447275 100644 (file)
@@ -583,10 +583,8 @@ main (int argc, char *argv[])
   g_test_add_func ("/sortlistmodel/create", test_create);
   g_test_add_func ("/sortlistmodel/set-model", test_set_model);
   g_test_add_func ("/sortlistmodel/set-sorter", test_set_sorter);
-#if GLIB_CHECK_VERSION (2, 58, 0) /* g_list_store_splice() is broken before 2.58 */
   g_test_add_func ("/sortlistmodel/add_items", test_add_items);
   g_test_add_func ("/sortlistmodel/remove_items", test_remove_items);
-#endif
   g_test_add_func ("/sortlistmodel/stability", test_stability);
   g_test_add_func ("/sortlistmodel/incremental/remove", test_incremental_remove);
   g_test_add_func ("/sortlistmodel/oob-access", test_out_of_bounds_access);
index d8aba88698712aaf59342367e8c12ce3e9630bd6..6e8444e88e9875760554fa788fdffeca27f63d0d 100644 (file)
 
 #include "gtk/timsort/gtktimsortprivate.h"
 
-#if !GLIB_CHECK_VERSION (2, 67, 3)
-# define g_memdup2(mem,size)    g_memdup((mem), (size))
-#endif
-
 #define assert_sort_equal(a, b, size, n) \
   g_assert_cmpmem (a, sizeof (size) * n, b, sizeof (size) * n)
 
index a057a2e9d08fc6f035fe27d2b1c8a2b043cbdefc..d61d833dee99d102f8c1058cafde0518b5b79ac0 100644 (file)
@@ -69,13 +69,7 @@ static gboolean
 would_drop (GLogLevelFlags  level,
             const char     *domain)
 {
-#if GLIB_CHECK_VERSION (2, 68, 0)
   return g_log_writer_default_would_drop (level, domain);
-#else
-  return (level & (G_LOG_LEVEL_ERROR |
-                   G_LOG_LEVEL_CRITICAL |
-                   G_LOG_LEVEL_WARNING)) == 0;
-#endif
 }
 
 static gboolean
index a23c96ca1952b3383deb06f27a78f55daed64699..7001325e20cba4167fb7a14898a320cb5b380386 100644 (file)
@@ -1608,11 +1608,7 @@ opentmp:
 
   utime_buf.actime = path_stat.st_atime;
   utime_buf.modtime = cache_stat.st_mtime;
-#if GLIB_CHECK_VERSION (2, 17, 1)
   g_utime (path, &utime_buf);
-#else
-  utime (path, &utime_buf);
-#endif
 
   if (!quiet)
     g_printerr (_("Cache file created successfully.\n"));