7b5d6cf860fb93f4c5e634a9a757599789dfae47
[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
8 #ifndef __GLIB_COMPAT_PRIVATE_H__
9 #define __GLIB_COMPAT_PRIVATE_H__
10
11 #include <glib.h>
12
13 G_BEGIN_DECLS
14
15 #if !GLIB_CHECK_VERSION(2,25,0)
16
17 #if defined (_MSC_VER) && !defined(_WIN64)
18 typedef struct _stat32 GStatBuf;
19 #else
20 typedef struct stat GStatBuf;
21 #endif
22
23 #endif
24
25 #if GLIB_CHECK_VERSION(2,26,0)
26 #define GLIB_HAS_GDATETIME
27 #endif
28
29 /* See bug #651514 */
30 #if GLIB_CHECK_VERSION(2,29,5)
31 #define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
32     g_atomic_pointer_compare_and_exchange ((a),(b),(c))
33 #define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
34     g_atomic_int_compare_and_exchange ((a),(b),(c))
35 #else
36 #define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
37     g_atomic_pointer_compare_and_exchange ((volatile gpointer *)(a),(b),(c))
38 #define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
39     g_atomic_int_compare_and_exchange ((volatile int *)(a),(b),(c))
40 #endif
41
42 /* See bug #651514 */
43 #if GLIB_CHECK_VERSION(2,29,5)
44 #define G_ATOMIC_INT_ADD(a,b) g_atomic_int_add ((a),(b))
45 #else
46 #define G_ATOMIC_INT_ADD(a,b) g_atomic_int_exchange_and_add ((a),(b))
47 #endif
48
49 /* copies */
50
51 /* adaptations */
52
53 G_END_DECLS
54
55 #endif