summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-08-26 11:52:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-29 17:03:41 +0200
commite59a5f9fdcec5df2f54e88d75a75fcb4a2fe577b (patch)
treee796a15b9424e3d62060ab8794f954c095144f1e /src
parent4ffa60e03a6ef1a7b8c8458377697b25c07eda8b (diff)
Windows: Fix compilation with MinGW-64, gcc 4.8.1
A definition for FILE_ID_128 was added. Change-Id: Ifdfe5da1b15a90afdf5cf09d92838a04b1cf5c19 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index e8904b0ab7..57231b57a9 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -573,9 +573,12 @@ typedef enum { Q_FileIdInfo = 18 } Q_FILE_INFO_BY_HANDLE_CLASS;
# if defined(Q_CC_MINGW) || (defined(Q_CC_MSVC) && _MSC_VER < 1700)
+// MinGW-64 defines FILE_ID_128 as of gcc-4.8.1 along with FILE_SUPPORTS_INTEGRITY_STREAMS
+# if !(defined(Q_CC_MINGW) && defined(FILE_SUPPORTS_INTEGRITY_STREAMS))
typedef struct _FILE_ID_128 {
BYTE Identifier[16];
} FILE_ID_128, *PFILE_ID_128;
+# endif // !(Q_CC_MINGW && FILE_SUPPORTS_INTEGRITY_STREAMS)
typedef struct _FILE_ID_INFO {
ULONGLONG VolumeSerialNumber;
@@ -614,7 +617,8 @@ QByteArray fileIdWin8(HANDLE handle)
&infoEx, sizeof(FILE_ID_INFO))) {
result = QByteArray::number(infoEx.VolumeSerialNumber, 16);
result += ':';
- result += QByteArray((char *)infoEx.FileId.Identifier, sizeof(infoEx.FileId.Identifier)).toHex();
+ // Note: MinGW-64's definition of FILE_ID_128 differs from the MSVC one.
+ result += QByteArray((char *)&infoEx.FileId, sizeof(infoEx.FileId)).toHex();
}
}
return result;