3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_GLIBCOMPAT_H
23 #define PURPLE_GLIBCOMPAT_H
26 * @section_id: libpurple-glibcompat
27 * @short_description: <filename>glibcompat.h</filename>
28 * @title: GLib version-dependent definitions
30 * This file is internal to libpurple. Do not use!
31 * Also, any public API should not depend on this file.
36 /* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and
37 * possibly other 32-bit windows), so instead of relying on it,
38 * we'll define our own.
40 #if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64)
41 # include <glib/gstdio.h>
42 typedef struct _stat GStatBufW32
;
44 purple_g_stat(const gchar
*filename
, GStatBufW32
*buf
)
46 return g_stat(filename
, (GStatBuf
*)buf
);
48 # define GStatBuf GStatBufW32
49 # define g_stat purple_g_stat
55 #undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
56 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
57 _Pragma ("clang diagnostic push") \
58 _Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"")
60 #undef G_GNUC_END_IGNORE_DEPRECATIONS
61 #define G_GNUC_END_IGNORE_DEPRECATIONS \
62 _Pragma ("clang diagnostic pop")
64 #endif /* __clang__ */
67 /******************************************************************************
69 *****************************************************************************/
70 #if !GLIB_CHECK_VERSION(2, 46, 0)
71 #define g_assert_cmpmem(m1, l1, m2, l2) G_STMT_START {\
72 gconstpointer __m1 = m1, __m2 = m2; \
73 int __l1 = l1, __l2 = l2; \
75 g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
76 #l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", __l1, "==", __l2, 'i'); \
77 else if (memcmp (__m1, __m2, __l1) != 0) \
78 g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
79 "assertion failed (" #m1 " == " #m2 ")"); \
83 #endif /* PURPLE_GLIBCOMPAT_H */