mirror of
https://github.com/transmission/transmission.git
synced 2026-04-18 07:56:33 +01:00
since Transmission supports older versions of glib, add a portability wrapper for G_DEFINE_QUARK
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
#include "tr-icon.h"
|
#include "tr-icon.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static G_DEFINE_QUARK (tr_core, core)
|
static TR_DEFINE_QUARK (tr_core, core)
|
||||||
|
|
||||||
#define ICON_NAME "transmission"
|
#define ICON_NAME "transmission"
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ typedef struct
|
|||||||
}
|
}
|
||||||
PrivateData;
|
PrivateData;
|
||||||
|
|
||||||
static G_DEFINE_QUARK (private_data, private_data)
|
static TR_DEFINE_QUARK (private_data, private_data)
|
||||||
|
|
||||||
static PrivateData*
|
static PrivateData*
|
||||||
get_private_data (GtkWindow * w)
|
get_private_data (GtkWindow * w)
|
||||||
|
|||||||
@@ -664,7 +664,7 @@ freespace_label_data_free (gpointer gdata)
|
|||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static G_DEFINE_QUARK (freespace_label_data, freespace_label_data)
|
static TR_DEFINE_QUARK (freespace_label_data, freespace_label_data)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_freespace_label_core_destroyed (gpointer gdata, GObject * dead_core G_GNUC_UNUSED)
|
on_freespace_label_core_destroyed (gpointer gdata, GObject * dead_core G_GNUC_UNUSED)
|
||||||
|
|||||||
17
gtk/util.h
17
gtk/util.h
@@ -37,6 +37,23 @@ extern const char * speed_M_str;
|
|||||||
extern const char * speed_G_str;
|
extern const char * speed_G_str;
|
||||||
extern const char * speed_T_str;
|
extern const char * speed_T_str;
|
||||||
|
|
||||||
|
#if GLIB_CHECK_VERSION(2,33,12)
|
||||||
|
#define TR_DEFINE_QUARK G_DEFINE_QUARK
|
||||||
|
#else
|
||||||
|
#define TR_DEFINE_QUARK(QN, q_n) \
|
||||||
|
GQuark \
|
||||||
|
q_n##_quark (void) \
|
||||||
|
{ \
|
||||||
|
static GQuark q; \
|
||||||
|
\
|
||||||
|
if G_UNLIKELY (q == 0) \
|
||||||
|
q = g_quark_from_static_string (#QN); \
|
||||||
|
\
|
||||||
|
return q; \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* macro to shut up "unused parameter" warnings */
|
/* macro to shut up "unused parameter" warnings */
|
||||||
#ifndef UNUSED
|
#ifndef UNUSED
|
||||||
#define UNUSED G_GNUC_UNUSED
|
#define UNUSED G_GNUC_UNUSED
|
||||||
|
|||||||
Reference in New Issue
Block a user