app: move the g_set_str() hack to config-types.h

This commit is contained in:
Michael Natterer 2025-07-10 23:58:43 +02:00
parent a4a5b2e300
commit 5060cc06dd
5 changed files with 28 additions and 34 deletions

View file

@ -56,4 +56,32 @@ typedef struct _GimpTemplate GimpTemplate;
#define gimp_assert_not_reached g_assert_not_reached
#if ! GLIB_CHECK_VERSION(2, 76, 0)
/* Function copied from GLib 2.76.0 and made available privately so that
* we don't have to bump our dependency requirement.
*
* TODO: remove this when GLib requirement moves over 2.76.
*/
static inline gboolean g_set_str (char **str_pointer,
const char *new_str);
static inline gboolean
g_set_str (char **str_pointer,
const char *new_str)
{
char *copy;
if (*str_pointer == new_str ||
(*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0))
return FALSE;
copy = g_strdup (new_str);
g_free (*str_pointer);
*str_pointer = copy;
return TRUE;
}
#endif
#endif /* __CONFIG_TYPES_H__ */

View file

@ -28,8 +28,6 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpconfig/gimpconfig.h"
#include "core/core-types.h" /* Temporary g_set_str() redefined */
#include "config-types.h"
#include "gimprc-blurbs.h"

View file

@ -26,8 +26,6 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
#include "core/core-types.h" /* Temporary g_set_str() redefined */
#include "config-types.h"
#include "gimprc-blurbs.h"

View file

@ -26,8 +26,6 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpconfig/gimpconfig.h"
#include "core/core-types.h" /* Temporary g_set_str() redefined */
#include "config-types.h"
#include "gimprc-blurbs.h"

View file

@ -322,32 +322,4 @@ struct _GimpSegment
#include "plug-in/plug-in-types.h"
#if ! GLIB_CHECK_VERSION(2, 76, 0)
/* Function copied from GLib 2.76.0 and made available privately so that
* we don't have to bump our dependency requirement.
*
* TODO: remove this when GLib requirement moves over 2.76.
*/
static inline gboolean g_set_str (char **str_pointer,
const char *new_str);
static inline gboolean
g_set_str (char **str_pointer,
const char *new_str)
{
char *copy;
if (*str_pointer == new_str ||
(*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0))
return FALSE;
copy = g_strdup (new_str);
g_free (*str_pointer);
*str_pointer = copy;
return TRUE;
}
#endif
#endif /* __CORE_TYPES_H__ */