pidgin/pidgin

Parents fb2056ce3c58
Children cf9821fc48e7
Move the glib compat functions to static inline as they were causing linking issues with plugins when they were normal functions

Testing Done:
Compile only

Reviewed at https://reviews.imfreedom.org/r/491/
--- a/libpurple/Makefile.am Sun Feb 07 01:33:01 2021 -0600
+++ b/libpurple/Makefile.am Thu Feb 11 23:53:15 2021 -0600
@@ -47,7 +47,6 @@
desktopitem.c \
eventloop.c \
ft.c \
- glibcompat.c \
idle.c \
imgstore.c \
log.c \
--- a/libpurple/glibcompat.c Sun Feb 07 01:33:01 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/* purple
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- */
-
-#include "glibcompat.h"
-
-#if !GLIB_CHECK_VERSION(2,32,0)
-
-gboolean
-g_hash_table_contains(GHashTable *hash_table, gconstpointer key) {
- return g_hash_table_lookup_extended(hash_table, key, NULL, NULL);
-}
-
-void
-g_queue_free_full(GQueue *queue, GDestroyNotify free_func) {
- GList *l = NULL;
-
- for(l = queue->head; l != NULL; l = l->next) {
- free_func(l->data);
- }
-
- g_queue_free(queue);
-}
-
-#endif /* !GLIB_CHECK_VERSION(2,32,0) */
-
--- a/libpurple/glibcompat.h Sun Feb 07 01:33:01 2021 -0600
+++ b/libpurple/glibcompat.h Thu Feb 11 23:53:15 2021 -0600
@@ -33,9 +33,21 @@
# define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
# define G_GNUC_END_IGNORE_DEPRECATIONS
-void g_queue_free_full(GQueue *queue, GDestroyNotify free_func);
+static inline void
+g_queue_free_full(GQueue *queue, GDestroyNotify free_func) {
+ GList *l = NULL;
+
+ for(l = queue->head; l != NULL; l = l->next) {
+ free_func(l->data);
+ }
-gboolean g_hash_table_contains (GHashTable *hash_table, gconstpointer key);
+ g_queue_free(queue);
+}
+
+static inline gboolean
+g_hash_table_contains(GHashTable *hash_table, gconstpointer key) {
+ return g_hash_table_lookup_extended(hash_table, key, NULL, NULL);
+}
#endif /* !GLIB_CHECK_VERSION(2,32,0) */