libpurple/glibcompat.h

Mon, 04 Feb 2013 21:56:45 -0500

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 04 Feb 2013 21:56:45 -0500
changeset 33838
3c73956dbeca
parent 33593
44c5f3ab8ffc
child 33882
29a7df06f410
permissions
-rw-r--r--

Ignore some deprecations.

These GValueArray things are forced on us by GStreamer, so until they
change their API, the warnings won't be going away.

33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
1 /* pidgin
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
2 *
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
5 * source distribution.
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
6 *
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
10 * (at your option) any later version.
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
11 *
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
15 * GNU General Public License for more details.
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
16 *
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
20 */
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
21 #ifndef _PIDGINGLIBCOMPAT_H_
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
22 #define _PIDGINGLIBCOMPAT_H_
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
23
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
24 /* This file is internal to Pidgin. Do not use!
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
25 * Also, any public API should not depend on this file.
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
26 */
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
27
33838
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
28 #if !GLIB_CHECK_VERSION(2, 32, 0)
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
29
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
30 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
31 #define G_GNUC_END_IGNORE_DEPRECATIONS
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
32
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
33 #if !GLIB_CHECK_VERSION(2, 28, 0)
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
34
33467
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
35 static inline gint64 g_get_monotonic_time(void)
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
36 {
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
37 GTimeVal time_s;
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
38
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
39 g_get_current_time(&time_s);
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
40
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
41 return ((gint64)time_s.tv_sec << 32) | time_s.tv_usec;
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
42 }
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
43
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
44 static inline void g_list_free_full(GList *list, GDestroyNotify free_func)
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
45 {
33467
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
46 g_list_foreach(list, (GFunc)free_func, NULL);
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
47 g_list_free(list);
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
48 }
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
49
33369
4a43f6a6326b Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33368
diff changeset
50 static inline void g_slist_free_full(GSList *list, GDestroyNotify free_func)
4a43f6a6326b Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33368
diff changeset
51 {
33467
5d9c3ec722d6 Better compatibility with old glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33369
diff changeset
52 g_slist_foreach(list, (GFunc)free_func, NULL);
33369
4a43f6a6326b Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33368
diff changeset
53 g_slist_free(list);
4a43f6a6326b Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33368
diff changeset
54 }
4a43f6a6326b Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33368
diff changeset
55
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
56 #endif /* 2.28.0 */
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
57
33838
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
58 #endif /* 2.32.0 */
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
59
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
60 #endif /* _PIDGINGLIBCOMPAT_H_ */
33838
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33593
diff changeset
61

mercurial