Unconditionally replace g_string_free_and_steal().
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 4 Nov 2023 00:29:14 +0000 (17:29 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 4 Nov 2023 00:55:06 +0000 (17:55 -0700)
It's a persistent problem and I don't understand why.  I hope this fixes
the issue for good.

Thanks to Ali Alhaidary for reporting this bug.

Bug #64848.

src/ui/gui/include/glib.in.h

index b87cb97c1e8029c63ac986edf10d1ae2350da706..94f97108865a58a52b21bcedaf6957334ba80b70 100644 (file)
@@ -49,12 +49,14 @@ g_memdup2 (gconstpointer mem,
 }
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 76, 0)
+/* g_string_free_and_steal() was introduced in glib 2.76 but it is a persistent
+   problem.  I don't understand why.  It's easiest to just unconditionally
+   replace it. */
+#define g_string_free_and_steal rpl_g_string_free_and_steal
 static inline gchar *
-g_string_free_and_steal (GString *string)
+rpl_g_string_free_and_steal (GString *string)
 {
-  return g_string_free (string, FALSE);
+  return (g_string_free) (string, FALSE);
 }
-#endif
 
 #endif /* PSPP_GLIB_H */