2005-11-21 18:03:22 +00:00
|
|
|
/*
|
|
|
|
* glib-compat.c
|
2007-09-19 13:28:40 +00:00
|
|
|
* Functions copied from glib 2.10
|
2005-11-21 18:03:22 +00:00
|
|
|
*
|
|
|
|
* Copyright 2005 David Schleef <ds@schleef.org>
|
|
|
|
*/
|
|
|
|
|
2010-09-28 20:46:29 +00:00
|
|
|
#ifndef __GLIB_COMPAT_PRIVATE_H__
|
|
|
|
#define __GLIB_COMPAT_PRIVATE_H__
|
|
|
|
|
2005-11-21 18:03:22 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-07-16 16:53:38 +00:00
|
|
|
#if !GLIB_CHECK_VERSION(2,25,0)
|
2010-12-23 00:36:09 +00:00
|
|
|
|
|
|
|
#if defined (_MSC_VER) && !defined(_WIN64)
|
|
|
|
typedef struct _stat32 GStatBuf;
|
|
|
|
#else
|
2010-07-16 16:53:38 +00:00
|
|
|
typedef struct stat GStatBuf;
|
|
|
|
#endif
|
|
|
|
|
2010-12-23 00:36:09 +00:00
|
|
|
#endif
|
|
|
|
|
2010-09-27 22:35:08 +00:00
|
|
|
#if GLIB_CHECK_VERSION(2,26,0)
|
|
|
|
#define GLIB_HAS_GDATETIME
|
|
|
|
#endif
|
|
|
|
|
2011-06-04 07:30:15 +00:00
|
|
|
/* See bug #651514 */
|
|
|
|
#if GLIB_CHECK_VERSION(2,29,5)
|
|
|
|
#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
|
|
|
|
g_atomic_pointer_compare_and_exchange ((a),(b),(c))
|
|
|
|
#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
|
|
|
|
g_atomic_int_compare_and_exchange ((a),(b),(c))
|
|
|
|
#else
|
|
|
|
#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
|
|
|
|
g_atomic_pointer_compare_and_exchange ((volatile gpointer *)(a),(b),(c))
|
|
|
|
#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
|
|
|
|
g_atomic_int_compare_and_exchange ((volatile int *)(a),(b),(c))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* See bug #651514 */
|
|
|
|
#if GLIB_CHECK_VERSION(2,29,5)
|
|
|
|
#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_add ((a),(b))
|
|
|
|
#else
|
|
|
|
#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_exchange_and_add ((a),(b))
|
|
|
|
#endif
|
|
|
|
|
2005-11-21 18:03:22 +00:00
|
|
|
/* copies */
|
|
|
|
|
|
|
|
/* adaptations */
|
|
|
|
|
|
|
|
G_END_DECLS
|
2010-09-28 20:46:29 +00:00
|
|
|
|
|
|
|
#endif
|