]> spindle.queued.net Git - midori/commitdiff
Add g_strcmp0 to compat, it's Glib 2.16
authorChristian Dywan <christian@twotoasts.de>
Sat, 18 Oct 2008 23:52:21 +0000 (01:52 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 18 Oct 2008 23:52:21 +0000 (01:52 +0200)
midori/compat.c
midori/compat.h

index 7a871ad18caedcd4beaf96b8d52d07e371c4f940..cd6243d55b221a6a5c611322cb95a4cad5b276b7 100644 (file)
 
 #include "compat.h"
 
+#if !GLIB_CHECK_VERSION(2, 16, 0)
+
+/* Glib string function
+   Copyright (C) 2008 Tim Janik <timj@imendio.com>
+   Copied from Glib 2.16, coding style adjusted */
+gint
+g_strcmp0 (const gchar* string1,
+           const gchar* string2)
+{
+    if (!string1)
+        return -(str1 != str2);
+    if (!string2)
+        return string1 != string2;
+    return strcmp (string1, string2);
+}
+
+#endif
+
 #if !GTK_CHECK_VERSION(2, 14, 0)
 
 #if HAVE_GIO
index bd03cf97598d6bae4d732b338d28adf209734738..49cb3e60512ac0c9b6dbeed57361e31d3980f401 100644 (file)
 
 G_BEGIN_DECLS
 
+#if !GLIB_CHECK_VERSION(2, 16, 0)
+
+gint
+g_strcmp0 (const gchar* string1,
+           const gchar* string2);
+
+#endif
+
 #if !GTK_CHECK_VERSION(2, 14, 0)
 
 #if HAVE_GIO