From: Ben Pfaff Date: Sat, 4 Nov 2023 00:29:14 +0000 (-0700) Subject: Unconditionally replace g_string_free_and_steal(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43669f58f3381dd009b84c8f92ac56462f4f2932;p=pspp Unconditionally replace g_string_free_and_steal(). 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. --- diff --git a/src/ui/gui/include/glib.in.h b/src/ui/gui/include/glib.in.h index b87cb97c1e..94f9710886 100644 --- a/src/ui/gui/include/glib.in.h +++ b/src/ui/gui/include/glib.in.h @@ -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 */