From 5f78aad62507ba7bfc3b843140258fcd56f4491e Mon Sep 17 00:00:00 2001 From: Rene Hexel Date: Wed, 12 Mar 2025 21:01:06 +1000 Subject: [PATCH] Make this work with glib-2.84 --- README.md | 2 +- Sources/CGLib/glib_bridging.h | 4 +++- Sources/GLib/GLib-2.0-2.84.0.sed | 2 ++ Sources/GLib/GLib-2.0.exclude | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 Sources/GLib/GLib-2.0-2.84.0.sed diff --git a/README.md b/README.md index d3d1bc4d..1f206133 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ on macOS, or on Linux you should get something like: ### Gtk 3.22 or higher -The Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, 2.68, 2.70, 2.72, 2.74, 2.76, 2.78, 2.80 and 2.82, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, 4.6, 4.8, 4.10, 4.12, 4.14, and 4.16 on the `gtk4` branch. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed. +The Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, 2.68, 2.70, 2.72, 2.74, 2.76, 2.78, 2.80, 2.82 and 2.84, and gdk/gtk 3.22, 3.24 as well as 4.0, 4.2, 4.4, 4.6, 4.8, 4.10, 4.12, 4.14, and 4.16 on the `gtk4` branch. They should work with higher versions, but YMMV. Also make sure you have `gobject-introspection` and its `.gir` files installed. #### Linux diff --git a/Sources/CGLib/glib_bridging.h b/Sources/CGLib/glib_bridging.h index 3219913d..e47b545f 100644 --- a/Sources/CGLib/glib_bridging.h +++ b/Sources/CGLib/glib_bridging.h @@ -12,7 +12,7 @@ extern int g_open(const char *, int, ...) __nonnull ((1)); #include #include #undef __GLIB_H_INSIDE__ -#if defined(__linux__) && defined(__aarch64__) +#if defined(__linux__) #undef g_open #endif @@ -70,7 +70,9 @@ struct _GUnixSocketAddressPrivate {}; struct _GUri {}; struct _GVariant {}; struct _GVariantType {}; +#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 84 struct GMainContextPusher {}; +#endif struct GMutexLocker {}; struct GTestCase {}; struct GTestSuite {}; diff --git a/Sources/GLib/GLib-2.0-2.84.0.sed b/Sources/GLib/GLib-2.0-2.84.0.sed new file mode 100644 index 00000000..1667104e --- /dev/null +++ b/Sources/GLib/GLib-2.0-2.84.0.sed @@ -0,0 +1,2 @@ +s|UnsafeMutablePointer|UnsafeMutableRawPointer|g +s|UnsafePointer|UnsafeRawPointer|g diff --git a/Sources/GLib/GLib-2.0.exclude b/Sources/GLib/GLib-2.0.exclude index 599e7d89..acf80966 100644 --- a/Sources/GLib/GLib-2.0.exclude +++ b/Sources/GLib/GLib-2.0.exclude @@ -3,3 +3,6 @@ String_autoptr g_iconv g_time_zone_new macro__has_attribute___noreturn__ +macro__has_attribute_ifunc +macro__has_attribute_no_sanitize_address +MainContextPusher