tizen 2.3 release
[framework/multimedia/gst-plugins-ext0.10.git] / dashdemux / src / glibcompat.h
1 /*\r
2  * glibcompat.h\r
3  *\r
4  * Copyright (C) 2013 Douglas Gore <doug@ssonic.co.uk>\r
5  *\r
6  * Authors:\r
7  *   Douglas Gore <doug@ssonic.co.uk>\r
8  *\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
13  *\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
18  *\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
23  */\r
24 \r
25 #ifndef GLIBCOMPAT_H_\r
26 #define GLIBCOMPAT_H_\r
27 \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
31 \r
32 #include <glib.h>\r
33 \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
40 #else\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
46 #endif\r
47 \r
48 #endif /* GLIBCOMPAT_H_ */\r