summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2008-12-15 14:38:07 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2008-12-15 14:38:07 +0000
commitfc451333fd43018c4b4f6bb301d42f661773ef31 (patch)
treebe49930336d908b2d7d4d78cd8ae24c6dcb07821
parent18183e9c5ed4e843c1dd4998356105528b891def (diff)
downloadlibgpod-tmz-fc451333fd43018c4b4f6bb301d42f661773ef31.tar.gz
libgpod-tmz-fc451333fd43018c4b4f6bb301d42f661773ef31.tar.xz
libgpod-tmz-fc451333fd43018c4b4f6bb301d42f661773ef31.zip
* 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. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2170 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--ChangeLog9
-rw-r--r--src/itdb_device.c7
-rw-r--r--src/itdb_plist.c7
3 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3445545..b2d9d00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-15 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+ * 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 <jcsjcs at users.sourceforge.net>
* 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 <sys/stat.h>
#include <sys/types.h>
#include <time.h>
+#ifdef __CYGWIN__
+ extern __IMPORT long _timezone;
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#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);