/pidgin/main: 6aa16fdab83f: Fix compilation of older distros. Fi...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Fri Sep 7 08:03:26 EDT 2012


Changeset: 6aa16fdab83f88fccb5c81504cc6d538593ed01c
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-09-07 14:03 +0200
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/6aa16fdab83f

Description:

Fix compilation of older distros. Fixes #15310

diffstat:

 Makefile.am                       |   2 +-
 configure.ac                      |   6 +---
 libpurple/glibcompat.h            |  44 +++++++++++++++++++++++++++++++++++++++
 libpurple/protocols/gg/avatar.c   |   1 +
 libpurple/protocols/gg/image.c    |   1 +
 libpurple/protocols/gg/roster.c   |   1 +
 libpurple/protocols/gg/servconn.c |   1 +
 7 files changed, 51 insertions(+), 5 deletions(-)

diffs (121 lines):

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,7 @@ EXTRA_DIST = \
 		HACKING \
 		Makefile.mingw \
 		PLUGIN_HOWTO \
-		README.MTN \
+		README.hg \
 		README.mingw \
 		config.h.mingw \
 		doxy2devhelp.xsl \
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -820,10 +820,8 @@ dnl # Check for zlib (required)
 dnl #######################################################################
 
 PKG_CHECK_MODULES(ZLIB, [zlib >= 1.2.0], , [
-	AC_MSG_RESULT(no)
-	AC_MSG_ERROR([
-You must have zlib >= 1.2.0 development headers installed to build.
-])])
+	AC_SEARCH_LIBS([deflate], [z], [], AC_MSG_ERROR([You must have zlib >= 1.2.0 development headers installed to build.]), [])
+])
 
 AC_SUBST(ZLIB_CFLAGS)
 AC_SUBST(ZLIB_LIBS)
diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
new file mode 100644
--- /dev/null
+++ b/libpurple/glibcompat.h
@@ -0,0 +1,44 @@
+/* pidgin
+ *
+ * Pidgin 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
+ */
+#ifndef _PIDGINGLIBCOMPAT_H_
+#define _PIDGINGLIBCOMPAT_H_
+
+/* This file is internal to Pidgin. Do not use!
+ * Also, any public API should not depend on this file.
+ */
+
+#if !GLIB_CHECK_VERSION(2, 28, 0)
+
+static inline void g_list_free_full(GList *list, GDestroyNotify free_func)
+{
+	GList *it;
+	it = g_list_first(list);
+	while (it)
+	{
+		free_func(it->data);
+		it = g_list_next(it);
+	}
+	g_list_free(list);
+}
+
+#endif /* 2.28.0 */
+
+#endif /* _PIDGINGLIBCOMPAT_H_ */
diff --git a/libpurple/protocols/gg/avatar.c b/libpurple/protocols/gg/avatar.c
--- a/libpurple/protocols/gg/avatar.c
+++ b/libpurple/protocols/gg/avatar.c
@@ -30,6 +30,7 @@
 #include "avatar.h"
 
 #include <debug.h>
+#include <glibcompat.h>
 
 #include "gg.h"
 #include "utils.h"
diff --git a/libpurple/protocols/gg/image.c b/libpurple/protocols/gg/image.c
--- a/libpurple/protocols/gg/image.c
+++ b/libpurple/protocols/gg/image.c
@@ -30,6 +30,7 @@
 #include "image.h"
 
 #include <debug.h>
+#include <glibcompat.h>
 
 #include "gg.h"
 #include "utils.h"
diff --git a/libpurple/protocols/gg/roster.c b/libpurple/protocols/gg/roster.c
--- a/libpurple/protocols/gg/roster.c
+++ b/libpurple/protocols/gg/roster.c
@@ -35,6 +35,7 @@
 #include "purplew.h"
 
 #include <debug.h>
+#include <glibcompat.h>
 
 #define GGP_ROSTER_SYNC_SETT "gg-synchronized"
 #define GGP_ROSTER_DEBUG 0
diff --git a/libpurple/protocols/gg/servconn.c b/libpurple/protocols/gg/servconn.c
--- a/libpurple/protocols/gg/servconn.c
+++ b/libpurple/protocols/gg/servconn.c
@@ -32,6 +32,7 @@
 #include "utils.h"
 
 #include <debug.h>
+#include <glibcompat.h>
 
 #define GGP_SERVCONN_HISTORY_PREF "/plugins/prpl/gg/server_history"
 #define GGP_SERVCONN_HISTORY_MAXLEN 15



More information about the Commits mailing list