Commit 3c03cae2 authored by Florent Revest's avatar Florent Revest

buteo-mtp: Fix build with newer GCC that enforces flexible array position in classes

parent fe3ed87e
From c797a87345aa352b3c440a626704472fcb7daa0b Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
Date: Wed, 24 May 2017 21:21:02 +0200
Subject: [PATCH 1/2] mtp1descriptors: redine htole16, htole32... to make sure
they are constant and can initialize our structures
---
mts/transport/usb/mtp1descriptors.h | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/mts/transport/usb/mtp1descriptors.h b/mts/transport/usb/mtp1descriptors.h
index 2d356a4..05e9d2f 100644
--- a/mts/transport/usb/mtp1descriptors.h
+++ b/mts/transport/usb/mtp1descriptors.h
@@ -4,6 +4,39 @@
#include <linux/usb/functionfs.h>
#include "ptp.h"
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define htobe16(x) __bswap_16 (x)
+# define htole16(x) (x)
+# define be16toh(x) __bswap_16 (x)
+# define le16toh(x) (x)
+
+# define htobe32(x) __bswap_32 (x)
+# define htole32(x) (x)
+# define be32toh(x) __bswap_32 (x)
+# define le32toh(x) (x)
+
+# define htobe64(x) __bswap_64 (x)
+# define htole64(x) (x)
+# define be64toh(x) __bswap_64 (x)
+# define le64toh(x) (x)
+
+# else
+# define htobe16(x) (x)
+# define htole16(x) __bswap_16 (x)
+# define be16toh(x) (x)
+# define le16toh(x) __bswap_16 (x)
+
+# define htobe32(x) (x)
+# define htole32(x) __bswap_32 (x)
+# define be32toh(x) (x)
+# define le32toh(x) __bswap_32 (x)
+
+# define htobe64(x) (x)
+# define htole64(x) __bswap_64 (x)
+# define be64toh(x) (x)
+# define le64toh(x) __bswap_64 (x)
+# endif
+
#define cpu_to_le16(x) htole16(x)
#define cpu_to_le32(x) htole32(x)
#define le32_to_cpu(x) le32toh(x)
--
2.11.0
From 50640967bb2b7906e8aed835fd9932d20fafc91b Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
Date: Wed, 24 May 2017 21:22:02 +0200
Subject: [PATCH 2/2] FSStoragePlugin: Make sure the inotify_event's flexible
array is placed at the end of class
---
mts/platform/storage/fsstorageplugin/fsstorageplugin.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/mts/platform/storage/fsstorageplugin/fsstorageplugin.h b/mts/platform/storage/fsstorageplugin/fsstorageplugin.h
index 7f6ea74..3c15430 100644
--- a/mts/platform/storage/fsstorageplugin/fsstorageplugin.h
+++ b/mts/platform/storage/fsstorageplugin/fsstorageplugin.h
@@ -405,12 +405,6 @@ private:
QHash<MTPObjFormatCode, QString> m_imageMimeTable; ///< Maps the MTP object format code (for image types only) to MIME type string
QString m_mtpPersistentDBPath;
MtpInt128 m_largestPuoid;
- struct INotifyCache
- {
- struct inotify_event fromEvent;
- QString fromName;
- }m_iNotifyCache; ///< A cache for iNotify events
-
struct ExistingPlaylists
{
QStringList playlistPaths;
@@ -433,6 +427,13 @@ private:
ObjHandle m_testHandleProvider;
friend class FSStoragePlugin_test;
#endif
+ struct INotifyCache
+ {
+ QString fromName;
+ struct inotify_event fromEvent;
+ }m_iNotifyCache; ///< A cache for iNotify events
+
+
};
}
--
2.11.0
...@@ -7,7 +7,9 @@ SRC_URI = "git://git.merproject.org/mer-core/buteo-mtp.git;protocol=https \ ...@@ -7,7 +7,9 @@ SRC_URI = "git://git.merproject.org/mer-core/buteo-mtp.git;protocol=https \
file://0001-Remove-dependency-to-SSU-and-tests.patch \ file://0001-Remove-dependency-to-SSU-and-tests.patch \
file://0002-Start-buteo-mtp-as-ceres-by-default.patch \ file://0002-Start-buteo-mtp-as-ceres-by-default.patch \
file://0003-Fixes-some-dependencies-to-contextkit-bash-and-syste.patch \ file://0003-Fixes-some-dependencies-to-contextkit-bash-and-syste.patch \
file://0004-fsstorageplugin-Expose-Watch-Memory-instead-of-Phone.patch" file://0004-fsstorageplugin-Expose-Watch-Memory-instead-of-Phone.patch \
file://0005-mtp1descriptors-redine-htole16-htole32.-to-make-sure.patch \
file://0006-FSStoragePlugin-Make-sure-the-inotify_event-s-flexib.patch"
SRCREV = "394df0cedd490f79b6eb2f4a22a2e2813d129432" SRCREV = "394df0cedd490f79b6eb2f4a22a2e2813d129432"
PR = "r1" PR = "r1"
PV = "+git${SRCPV}" PV = "+git${SRCPV}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment