[banshee/1.5.1-fixes: 44/56] Fix MTP issue on 64-bit installs
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/1.5.1-fixes: 44/56] Fix MTP issue on 64-bit installs
- Date: Mon, 22 Mar 2010 18:07:46 +0000 (UTC)
commit 82582350eee68c72b1bdc7c1dabe1aabde92b976
Author: Alan McGovern <alan mcgovern gmail com>
Date: Thu Dec 24 11:47:52 2009 -0600
Fix MTP issue on 64-bit installs
At built time check the size of time_t. Fixes BGO #594191.
Signed-off-by: Gabriel Burt <gabriel burt gmail com>
build/m4/banshee/dap-mtp.m4 | 2 ++
src/Libraries/Mtp/Makefile.am | 4 ++++
src/Libraries/Mtp/Mtp/MtpDevice.cs | 6 +++---
src/Libraries/Mtp/Mtp/Track.cs | 4 ++++
4 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/build/m4/banshee/dap-mtp.m4 b/build/m4/banshee/dap-mtp.m4
index c6068f1..c42738e 100644
--- a/build/m4/banshee/dap-mtp.m4
+++ b/build/m4/banshee/dap-mtp.m4
@@ -26,5 +26,7 @@ AC_DEFUN([BANSHEE_CHECK_DAP_MTP],
AM_CONDITIONAL(ENABLE_MTP, test "x$enable_libmtp" = "xyes")
AM_CONDITIONAL(LIBMTP_EIGHT, test "x$LIBMTP_SO_MAP" = "xlibmtp.so.8")
AM_CONDITIONAL(LIBMTP_TRACK_STRUCT_HAS_MODDATE, [test "$LIBMTP_HAS_MODDATE" = "yes"])
+ AC_CHECK_SIZEOF(time_t)
+ AM_CONDITIONAL(LIBMTP_SIZEOF_TIME_T_64, [test "x$ac_cv_sizeof_time_t" = "x8"])
])
diff --git a/src/Libraries/Mtp/Makefile.am b/src/Libraries/Mtp/Makefile.am
index 25462df..6a70d13 100644
--- a/src/Libraries/Mtp/Makefile.am
+++ b/src/Libraries/Mtp/Makefile.am
@@ -12,6 +12,10 @@ if LIBMTP_TRACK_STRUCT_HAS_MODDATE
BUILD_DEFINES += "-define:LIBMTP_TRACK_HAS_MODDATE"
endif
+if LIBMTP_SIZEOF_TIME_T_64
+BUILD_DEFINES += "-define:LIBMTP_SIZEOF_TIME_T_64"
+endif
+
SOURCES = \
Mtp/AbstractTrackList.cs \
Mtp/Album.cs \
diff --git a/src/Libraries/Mtp/Mtp/MtpDevice.cs b/src/Libraries/Mtp/Mtp/MtpDevice.cs
index bca0817..5673b8e 100644
--- a/src/Libraries/Mtp/Mtp/MtpDevice.cs
+++ b/src/Libraries/Mtp/Mtp/MtpDevice.cs
@@ -484,10 +484,10 @@ namespace Mtp
internal struct DeviceEntry
{
[MarshalAs(UnmanagedType.LPStr)] public string vendor;
- public short vendor_id;
+ public ushort vendor_id;
[MarshalAs(UnmanagedType.LPStr)] public string product;
- public short product_id;
- public int device_flags;
+ public ushort product_id;
+ public uint device_flags;
}
[StructLayout(LayoutKind.Sequential)]
diff --git a/src/Libraries/Mtp/Mtp/Track.cs b/src/Libraries/Mtp/Mtp/Track.cs
index 2213df9..c8ce10f 100644
--- a/src/Libraries/Mtp/Mtp/Track.cs
+++ b/src/Libraries/Mtp/Mtp/Track.cs
@@ -299,8 +299,12 @@ namespace Mtp
public uint usecount;
public ulong filesize;
#if LIBMTP_TRACK_HAS_MODDATE
+#if LIBMTP_SIZEOF_TIME_T_64
+ public ulong modificationdate;
+#else
public uint modificationdate;
#endif
+#endif
public FileType filetype;
public IntPtr next; // Track Null if last
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]