From fc451333fd43018c4b4f6bb301d42f661773ef31 Mon Sep 17 00:00:00 2001 From: Jorg Schuler Date: Mon, 15 Dec 2008 14:38:07 +0000 Subject: * src/itdb_plist.c: substitute g_base64_decode() between version 2.8 and 2.11 of glib. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/itdb_device.c: handle timezone correctly on CYGWIN Patches courtesy of Éric Lassauge. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2170 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- ChangeLog | 9 +++++++++ src/itdb_device.c | 7 +++++++ src/itdb_plist.c | 7 +++++++ 3 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3445545..b2d9d00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-12-15 Jorg Schuler + + * src/itdb_plist.c: substitute g_base64_decode() between version + 2.8 and 2.11 of glib. + + * src/itdb_device.c: handle timezone correctly on CYGWIN + + Patches courtesy of Éric Lassauge. + 2008-12-13 Jorg Schuler * po/fr.po: Update French translation (Éric Lassauge) diff --git a/src/itdb_device.c b/src/itdb_device.c index 1eace22..0051679 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -39,6 +39,9 @@ #include #include #include +#ifdef __CYGWIN__ + extern __IMPORT long _timezone; +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -1575,7 +1578,11 @@ static gboolean raw_timezone_to_utc_shift_5g (gint16 raw_timezone, static gint get_local_timezone (void) { +#ifdef __CYGWIN__ + return (gint) _timezone; /* global variable defined by time.h, see man tzset */ +#else return timezone; /* global variable defined by time.h, see man tzset */ +#endif } /* This function reads the timezone information from the iPod and sets it in diff --git a/src/itdb_plist.c b/src/itdb_plist.c index 6595401..eeadf65 100644 --- a/src/itdb_plist.c +++ b/src/itdb_plist.c @@ -177,7 +177,14 @@ parse_data (xmlNode *a_node, G_GNUC_UNUSED GError **error) GValue *value; str_val = (char *)xmlNodeGetContent(a_node); +#if GLIB_CHECK_VERSION(2,12,0) + /* base64 support only after GLib 2.12 */ raw_data = g_base64_decode (str_val, &len); +#else +#warning GLib > 2.12 required for g_base64_decode(). Working around this problem. + raw_data = g_strdup (""); + len = 0; +#endif xmlFree (str_val); data_val = g_string_new_len ((char *)raw_data, len); g_free (raw_data); -- cgit