changeset 31356:4ba00731d066

g_strcmp0 was added in glib 2.16.0, but we keep compatibility with 2.12. Implement backward compatibility by basically implementing g_strcmp0 within this function
author Mark Doliner <mark@kingant.net>
date Wed, 10 Nov 2010 01:00:42 +0000
parents d9db23719cf9
children e17ac5b9621f
files libpurple/protocols/msn/user.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/user.c	Mon Nov 08 22:51:35 2010 +0000
+++ b/libpurple/protocols/msn/user.c	Wed Nov 10 01:00:42 2010 +0000
@@ -742,7 +742,18 @@
 	str = purple_normalize_nocase(NULL, msn_user_get_passport(user));
 	pass = g_strdup(str);
 
+#if GLIB_CHECK_VERSION(2,16,0)
 	result = g_strcmp0(pass, purple_normalize_nocase(NULL, passport));
+#else
+	str = purple_normalize_nocase(NULL, passport);
+	if (!pass)
+		result = -(pass != str);
+	else if (!str)
+		result = pass != str;
+	else
+		result = strcmp(pass, str);
+#endif /* GLIB < 2.16.0 */
+
 	g_free(pass);
 
 	return result;