diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-09-30 17:46:47 +0100 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-10-01 09:21:05 +0100 |
commit | ea3348020da586f20e1a64c9732405e730563616 (patch) | |
tree | 471f0961124abdfecc0371aed290db4d9dd1937e | |
parent | 9f10231fc787e4683e896bf35f086906a5b16c03 (diff) | |
download | libnice-ea3348020da586f20e1a64c9732405e730563616.tar.gz |
agent: Remove redundant GLIB_CHECK_VERSION macros
We depend on GLib 2.36.0, which is a higher version than any of these
version checks cared about, so they were all trivially true or false.
Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D298
-rw-r--r-- | agent/agent.c | 24 | ||||
-rw-r--r-- | examples/sdp-example.c | 2 | ||||
-rw-r--r-- | examples/simple-example.c | 2 | ||||
-rw-r--r-- | examples/threaded-example.c | 2 | ||||
-rw-r--r-- | tests/test-io-stream-common.c | 5 | ||||
-rw-r--r-- | tests/test-thread.c | 11 |
6 files changed, 1 insertions, 45 deletions
diff --git a/agent/agent.c b/agent/agent.c index 0a99185..a41bc1d 100644 --- a/agent/agent.c +++ b/agent/agent.c @@ -133,11 +133,7 @@ enum static guint signals[N_SIGNALS]; -#if GLIB_CHECK_VERSION(2,31,8) static GMutex agent_mutex; /* Mutex used for thread-safe lib */ -#else -static GStaticMutex agent_mutex = G_STATIC_MUTEX_INIT; -#endif static void priv_stop_upnp (NiceAgent *agent); @@ -156,7 +152,6 @@ static void nice_agent_get_property (GObject *object, static void nice_agent_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); -#if GLIB_CHECK_VERSION(2,31,8) void agent_lock (void) { g_mutex_lock (&agent_mutex); @@ -167,19 +162,6 @@ void agent_unlock (void) g_mutex_unlock (&agent_mutex); } -#else -void agent_lock(void) -{ - g_static_mutex_lock (&agent_mutex); -} - -void agent_unlock(void) -{ - g_static_mutex_unlock (&agent_mutex); -} - -#endif - static GType _nice_agent_stream_ids_get_type (void); G_DEFINE_POINTER_TYPE (_NiceAgentStreamIds, _nice_agent_stream_ids); @@ -1811,13 +1793,7 @@ adjust_tcp_clock (NiceAgent *agent, Stream *stream, Component *component) if (timeout != component->last_clock_timeout) { component->last_clock_timeout = timeout; if (component->tcp_clock) { -#if GLIB_CHECK_VERSION (2, 36, 0) g_source_set_ready_time (component->tcp_clock, timeout * 1000); -#else - g_source_destroy (component->tcp_clock); - g_source_unref (component->tcp_clock); - component->tcp_clock = NULL; -#endif } if (!component->tcp_clock) { long interval = timeout - (guint32) (g_get_monotonic_time () / 1000); diff --git a/examples/sdp-example.c b/examples/sdp-example.c index bb95440..b6dd80a 100644 --- a/examples/sdp-example.c +++ b/examples/sdp-example.c @@ -44,9 +44,7 @@ #include <agent.h> -#if GLIB_CHECK_VERSION(2, 36, 0) #include <gio/gnetworking.h> -#endif static GMainLoop *gloop; static gchar *stun_addr = NULL; diff --git a/examples/simple-example.c b/examples/simple-example.c index 17702b1..6ce171a 100644 --- a/examples/simple-example.c +++ b/examples/simple-example.c @@ -44,9 +44,7 @@ #include <agent.h> -#if GLIB_CHECK_VERSION(2, 36, 0) #include <gio/gnetworking.h> -#endif static GMainLoop *gloop; static GIOChannel* io_stdin; diff --git a/examples/threaded-example.c b/examples/threaded-example.c index d23d7f9..575b4dc 100644 --- a/examples/threaded-example.c +++ b/examples/threaded-example.c @@ -44,9 +44,7 @@ #include <agent.h> -#if GLIB_CHECK_VERSION(2, 36, 0) #include <gio/gnetworking.h> -#endif static GMainLoop *gloop; static gchar *stun_addr = NULL; diff --git a/tests/test-io-stream-common.c b/tests/test-io-stream-common.c index bd0f3b5..efa6160 100644 --- a/tests/test-io-stream-common.c +++ b/tests/test-io-stream-common.c @@ -335,12 +335,7 @@ spawn_thread (const gchar *thread_name, GThreadFunc thread_func, { GThread *thread; -#if !GLIB_CHECK_VERSION(2, 31, 8) - thread = g_thread_create (thread_func, user_data, TRUE, NULL); -#else thread = g_thread_new (thread_name, thread_func, user_data); -#endif - g_assert (thread); return thread; diff --git a/tests/test-thread.c b/tests/test-thread.c index e05738c..7493f97 100644 --- a/tests/test-thread.c +++ b/tests/test-thread.c @@ -289,13 +289,8 @@ int main (void) /* step: run test the first time */ g_debug ("test-thread: TEST STARTS / running test for the 1st time"); -#if !GLIB_CHECK_VERSION(2,31,8) - lthread = g_thread_create (mainloop_thread, lmainloop, TRUE, NULL); - rthread = g_thread_create (mainloop_thread, rmainloop, TRUE, NULL); -#else lthread = g_thread_new ("lthread libnice", mainloop_thread, lmainloop); rthread = g_thread_new ("rthread libnice", mainloop_thread, rmainloop); -#endif g_assert (lthread); g_assert (rthread); @@ -316,13 +311,9 @@ int main (void) nice_agent_attach_recv (ragent, rs_id, 1, rdmainctx, cb_nice_recv, GUINT_TO_POINTER (2)); -#if !GLIB_CHECK_VERSION(2,31,8) - ldthread = g_thread_create (mainloop_thread, ldmainloop, TRUE, NULL); - rdthread = g_thread_create (mainloop_thread, rdmainloop, TRUE, NULL); -#else ldthread = g_thread_new ("ldthread libnice", mainloop_thread, ldmainloop); rdthread = g_thread_new ("rdthread libnice", mainloop_thread, rdmainloop); -#endif + g_assert (ldthread); g_assert (rdthread); |