app: move the g_set_str() hack to config-types.h
This commit is contained in:
parent
a4a5b2e300
commit
5060cc06dd
5 changed files with 28 additions and 34 deletions
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue