Update for new gthread API
[platform/upstream/gstreamer.git] / gst / glib-compat-private.h
1 /*
2  * glib-compat.c
3  * Functions copied from glib 2.10
4  *
5  * Copyright 2005 David Schleef <ds@schleef.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef __GLIB_COMPAT_PRIVATE_H__
24 #define __GLIB_COMPAT_PRIVATE_H__
25
26 #include <glib.h>
27
28 G_BEGIN_DECLS
29
30 #if !GLIB_CHECK_VERSION(2,25,0)
31
32 #if defined (_MSC_VER) && !defined(_WIN64)
33 typedef struct _stat32 GStatBuf;
34 #else
35 typedef struct stat GStatBuf;
36 #endif
37
38 #endif
39
40 #if GLIB_CHECK_VERSION(2,26,0)
41 #define GLIB_HAS_GDATETIME
42 #endif
43
44 /* See bug #651514 */
45 #if GLIB_CHECK_VERSION(2,29,5)
46 #define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
47     g_atomic_pointer_compare_and_exchange ((a),(b),(c))
48 #define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
49     g_atomic_int_compare_and_exchange ((a),(b),(c))
50 #else
51 #define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
52     g_atomic_pointer_compare_and_exchange ((volatile gpointer *)(a),(b),(c))
53 #define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
54     g_atomic_int_compare_and_exchange ((volatile int *)(a),(b),(c))
55 #endif
56
57 /* See bug #651514 */
58 #if GLIB_CHECK_VERSION(2,29,5)
59 #define G_ATOMIC_INT_ADD(a,b) g_atomic_int_add ((a),(b))
60 #else
61 #define G_ATOMIC_INT_ADD(a,b) g_atomic_int_exchange_and_add ((a),(b))
62 #endif
63
64 /* copies */
65
66 /* adaptations */
67
68 G_END_DECLS
69
70 #endif