4 * Copyright (C) 2013 Douglas Gore <doug@ssonic.co.uk>
\r
7 * Douglas Gore <doug@ssonic.co.uk>
\r
9 * This library is free software; you can redistribute it and/or
\r
10 * modify it under the terms of the GNU Library General Public
\r
11 * License as published by the Free Software Foundation; either
\r
12 * version 2 of the License, or (at your option) any later version.
\r
14 * This library is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
17 * Library General Public License for more details.
\r
19 * You should have received a copy of the GNU Library General Public
\r
20 * License along with this library; if not, write to the
\r
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
\r
22 * Boston, MA 02111-1307, USA.
\r
25 #ifndef GLIBCOMPAT_H_
\r
26 #define GLIBCOMPAT_H_
\r
28 /* The GLib threading API changed in 2.32, these macros are used to
\r
29 * provide backwards compatibility with older versions without
\r
30 * complicating the code. */
\r
34 #if (GLIB_CHECK_VERSION (2, 32, 0))
\r
35 #define G_MUTEX GMutex
\r
36 #define G_MUTEX_INIT(mutex) g_mutex_init(&mutex)
\r
37 #define G_MUTEX_CLEAR(mutex) g_mutex_clear (&mutex);
\r
38 #define G_MUTEX_LOCK(mutex) g_mutex_lock (&mutex)
\r
39 #define G_MUTEX_UNLOCK(mutex) g_mutex_unlock (&mutex)
\r
41 #define G_MUTEX GMutex*
\r
42 #define G_MUTEX_INIT(mutex) mutex = g_mutex_new()
\r
43 #define G_MUTEX_CLEAR(mutex) g_mutex_free (mutex)
\r
44 #define G_MUTEX_LOCK(mutex) g_mutex_lock (mutex)
\r
45 #define G_MUTEX_UNLOCK(mutex) g_mutex_unlock (mutex)
\r
48 #endif /* GLIBCOMPAT_H_ */
\r