From 26ca844e7388cd197b02d8f91688e1ab4fab84da Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 24 Feb 2015 08:23:05 -0500 Subject: [PATCH] drop support for glib versions older than 2.30 --- daemon/aux.c | 32 -------------------------------- daemon/aux.h | 6 ------ daemon/call_interfaces.c | 4 ---- daemon/call_interfaces.h | 2 -- daemon/control_ng.c | 2 -- daemon/cookie_cache.c | 6 ------ debian/control | 2 +- 7 files changed, 1 insertion(+), 53 deletions(-) diff --git a/daemon/aux.c b/daemon/aux.c index 3331dd2f0..840f75e4a 100644 --- a/daemon/aux.c +++ b/daemon/aux.c @@ -83,38 +83,6 @@ int pcre_multi_match(pcre *re, pcre_extra *ree, const char *s, unsigned int num, -#if !GLIB_CHECK_VERSION(2,14,0) - -void g_string_vprintf(GString *string, const gchar *format, va_list args) { - char *s; - int r; - - r = vasprintf(&s, format, args); - if (r < 0) - return; - - g_string_assign(string, s); - free(s); -} - -void g_queue_clear(GQueue *q) { - GList *l, *n; - - if (!q) - return; - - for (l = q->head; l; l = n) { - n = l->next; - g_list_free_1(l); - } - - q->head = q->tail = NULL; - q->length = 0; -} - -#endif - - static void thread_join_me() { pthread_t *me; diff --git a/daemon/aux.h b/daemon/aux.h index 6eaa2305a..05c7671c1 100644 --- a/daemon/aux.h +++ b/daemon/aux.h @@ -65,12 +65,6 @@ INLINE void strdupfree(char **, const char *); char *get_thread_buf(void); -#if !GLIB_CHECK_VERSION(2,14,0) -#define G_QUEUE_INIT { NULL, NULL, 0 } -void g_string_vprintf(GString *string, const gchar *format, va_list args); -void g_queue_clear(GQueue *); -#endif - #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; diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index e4a0dd6bc..4fabe1b8d 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -919,7 +919,6 @@ stats: ng_stats(bencode_dictionary_add_dictionary(dict, "RTCP"), &totals->totals[1], NULL); } -#if GLIB_CHECK_VERSION(2,16,0) static void ng_list_calls( struct callmaster *m, bencode_item_t *output, long long int limit) { GHashTableIter iter; gpointer key, value; @@ -933,7 +932,6 @@ static void ng_list_calls( struct callmaster *m, bencode_item_t *output, long lo rwlock_unlock_r(&m->hashlock); } -#endif @@ -958,7 +956,6 @@ const char *call_query_ng(bencode_item_t *input, struct callmaster *m, bencode_i } -#if GLIB_CHECK_VERSION(2,16,0) const char *call_list_ng(bencode_item_t *input, struct callmaster *m, bencode_item_t *output) { bencode_item_t *calls = NULL; long long int limit; @@ -975,4 +972,3 @@ const char *call_list_ng(bencode_item_t *input, struct callmaster *m, bencode_it return NULL; } -#endif diff --git a/daemon/call_interfaces.h b/daemon/call_interfaces.h index 5c1e68601..12db76fab 100644 --- a/daemon/call_interfaces.h +++ b/daemon/call_interfaces.h @@ -35,9 +35,7 @@ const char *call_offer_ng(bencode_item_t *, struct callmaster *, bencode_item_t const char *call_answer_ng(bencode_item_t *, struct callmaster *, bencode_item_t *); const char *call_delete_ng(bencode_item_t *, struct callmaster *, bencode_item_t *); const char *call_query_ng(bencode_item_t *, struct callmaster *, bencode_item_t *); -#if GLIB_CHECK_VERSION(2,16,0) const char *call_list_ng(bencode_item_t *, struct callmaster *, bencode_item_t *); -#endif void ng_call_stats(struct call *call, const str *fromtag, const str *totag, bencode_item_t *output, struct call_stats *totals); diff --git a/daemon/control_ng.c b/daemon/control_ng.c index ed5fcf8b0..dc0c1d1e5 100644 --- a/daemon/control_ng.c +++ b/daemon/control_ng.c @@ -153,12 +153,10 @@ static void control_ng_incoming(struct obj *obj, str *buf, struct sockaddr_in6 * errstr = call_query_ng(dict, c->callmaster, resp); g_atomic_int_inc(&cur->query); } -#if GLIB_CHECK_VERSION(2,16,0) else if (!str_cmp(&cmd, "list")) { errstr = call_list_ng(dict, c->callmaster, resp); g_atomic_int_inc(&cur->list); } -#endif else errstr = "Unrecognized command"; diff --git a/daemon/cookie_cache.c b/daemon/cookie_cache.c index b90de96af..8f5b2052d 100644 --- a/daemon/cookie_cache.c +++ b/daemon/cookie_cache.c @@ -27,14 +27,8 @@ void cookie_cache_init(struct cookie_cache *c) { static void __cookie_cache_check_swap(struct cookie_cache *c) { if (poller_now - c->swap_time >= 30) { g_hash_table_remove_all(c->old.cookies); -#if GLIB_CHECK_VERSION(2,14,0) g_string_chunk_clear(c->old.chunks); swap_ptrs(&c->old.chunks, &c->current.chunks); -#else - g_string_chunk_free(c->old.chunks); - c->old.chunks = c->current.chunks; - c->current.chunks = g_string_chunk_new(4 * 1024); -#endif swap_ptrs(&c->old.cookies, &c->current.cookies); c->swap_time = poller_now; } diff --git a/debian/control b/debian/control index 9a21efdd1..14eba8d66 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 5), iptables-dev (>= 1.4), libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl3-openssl-dev | libcurl3-gnutls-dev, - libglib2.0-dev, + libglib2.0-dev (>= 2.30), libpcre3-dev, libssl-dev (>= 1.0.1), libxmlrpc-c3-dev (>= 1.16.07) | libxmlrpc-core-c3-dev (>= 1.16.07),