Add g_strcmp0 to compat, it's Glib 2.16

This commit is contained in:
Christian Dywan 2008-10-19 01:52:21 +02:00
parent 3f78fc132e
commit a08b760d4e
2 changed files with 26 additions and 0 deletions

View file

@ -11,6 +11,24 @@
#include "compat.h" #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 !GTK_CHECK_VERSION(2, 14, 0)
#if HAVE_GIO #if HAVE_GIO

View file

@ -23,6 +23,14 @@
G_BEGIN_DECLS 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 !GTK_CHECK_VERSION(2, 14, 0)
#if HAVE_GIO #if HAVE_GIO