Commit ea334802 authored by Philip Withnall's avatar Philip Withnall

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's avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D298
parent 9f10231f
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment