MT#56374 update glib dependency to >= 2.40

and remove related version test macros.

Change-Id: I4eca21f4bf146ad8d13e775a5cd512ab1a190999
pull/1701/head
Richard Fuchs 2 years ago
parent f7c4eabaae
commit e58d36fb84

@ -1824,12 +1824,8 @@ cps_match:
}
// flush out crypto suites we ended up not using - leave only one
#if GLIB_CHECK_VERSION(2,30,0)
if (!g_queue_remove(cpq_in, cps_in))
ilogs(crypto, LOG_ERR, "BUG: incoming crypto suite not found in queue");
#else
g_queue_remove(cpq_in, cps_in);
#endif
crypto_params_sdes_queue_clear(cpq_in);
g_queue_push_tail(cpq_in, cps_in);

@ -1062,14 +1062,6 @@ static void init_everything(void) {
recording_fs_init(rtpe_config.spooldir, rtpe_config.rec_method, rtpe_config.rec_format);
rtpe_ssl_init();
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#if !(GLIB_CHECK_VERSION(2,36,0))
g_type_init();
#endif
#ifdef HAVE_MQTT
if (mosquitto_lib_init() != MOSQ_ERR_SUCCESS)
die("failed to init libmosquitto");

@ -1065,7 +1065,7 @@ static int json_get_hash(struct redis_hash *out,
str *val = json_reader_get_string_value_uri_enc(root_reader);
char* tmp = strdup(*members);
if (g_hash_table_insert_check(out->ht, tmp, val) != TRUE) {
if (g_hash_table_insert(out->ht, tmp, val) != TRUE) {
rlog(LOG_WARNING,"Key %s already exists", tmp);
goto err3;
}

2
debian/control vendored

@ -21,7 +21,7 @@ Build-Depends:
libdigest-crc-perl,
libdigest-hmac-perl,
libevent-dev (>= 2.0),
libglib2.0-dev (>= 2.30),
libglib2.0-dev (>= 2.40),
libhiredis-dev,
libio-multiplex-perl,
libio-socket-inet6-perl,

@ -21,28 +21,6 @@
#include "compat.h"
#include "auxlib.h"
#if !(GLIB_CHECK_VERSION(2,30,0))
#define g_atomic_int_and(atomic, val) \
(G_GNUC_EXTENSION ({ \
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
(void) (0 ? *(atomic) ^ (val) : 0); \
(guint) __sync_fetch_and_and ((atomic), (val)); \
}))
#define g_atomic_int_or(atomic, val) \
(G_GNUC_EXTENSION ({ \
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
(void) (0 ? *(atomic) ^ (val) : 0); \
(guint) __sync_fetch_and_or ((atomic), (val)); \
}))
#define g_atomic_pointer_add(atomic, val) \
(G_GNUC_EXTENSION ({ \
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
(void) (0 ? (gpointer) *(atomic) : 0); \
(void) (0 ? (val) ^ (val) : 0); \
(gssize) __sync_fetch_and_add ((atomic), (val)); \
}))
#endif
#if 0 && defined(__DEBUG)
#define __THREAD_DEBUG 1
#endif
@ -64,17 +42,6 @@ INLINE void strdupfree(char **, const char *);
GList *g_list_link(GList *, GList *);
#if !GLIB_CHECK_VERSION(2,32,0)
INLINE int g_hash_table_contains(GHashTable *h, const void *k) {
return g_hash_table_lookup(h, k) ? 1 : 0;
}
INLINE void g_queue_free_full(GQueue *q, GDestroyNotify free_func) {
void *d;
while ((d = g_queue_pop_head(q)))
free_func(d);
g_queue_free(q);
}
#endif
#if !GLIB_CHECK_VERSION(2,62,0)
// from https://github.com/GNOME/glib/blob/master/glib/glist.c

@ -88,19 +88,6 @@ extern struct redis *rtpe_redis_notify;
#if !GLIB_CHECK_VERSION(2,40,0)
INLINE gboolean g_hash_table_insert_check(GHashTable *h, gpointer k, gpointer v) {
gboolean ret = TRUE;
if (g_hash_table_contains(h, k))
ret = FALSE;
g_hash_table_insert(h, k, v);
return ret;
}
#else
# define g_hash_table_insert_check g_hash_table_insert
#endif
#define rlog(l, x...) ilog(l | LOG_FLAG_RESTORE, x)
void redis_notify_loop(void *d);

@ -307,11 +307,7 @@ void config_load(int *argc, char ***argv, GOptionEntry *app_entries, const char
// process CLI arguments again so they override options from the config file
c = g_option_context_new(description);
g_option_context_add_main_entries(c, entries, NULL);
#if !GLIB_CHECK_VERSION(2,40,0)
g_option_context_parse_strv(c, &saved_argv, &er);
#else
g_option_context_parse(c, &saved_argc, &saved_argv, &er);
#endif
// finally go through our list again to look for strings that were
// overwritten, and free the old values.

@ -19,11 +19,7 @@ static volatile int garbage_thread_num;
unsigned int garbage_new_thread_num(void) {
#if GLIB_CHECK_VERSION(2,30,0)
return g_atomic_int_add(&garbage_thread_num, 1);
#else
return g_atomic_int_exchange_and_add(&garbage_thread_num, 1);
#endif
}

Loading…
Cancel
Save