summaryrefslogtreecommitdiff
path: root/zen/file_id_def.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:14 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:14 +0200
commit01eb8253196672c969a39587e90b49321a182428 (patch)
tree4a3b71d7913de519744466c9227fda6461c4f0b5 /zen/file_id_def.h
parent5.0 (diff)
downloadFreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.gz
FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.bz2
FreeFileSync-01eb8253196672c969a39587e90b49321a182428.zip
5.1
Diffstat (limited to 'zen/file_id_def.h')
-rw-r--r--zen/file_id_def.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/zen/file_id_def.h b/zen/file_id_def.h
index b65496be..c51a0ecc 100644
--- a/zen/file_id_def.h
+++ b/zen/file_id_def.h
@@ -21,7 +21,7 @@
namespace zen
{
#ifdef FFS_WIN
-typedef std::pair<decltype(BY_HANDLE_FILE_INFORMATION().dwVolumeSerialNumber), decltype(ULARGE_INTEGER().QuadPart)> FileId; //(volume serial number, file ID)
+typedef std::pair<DWORD, ULONGLONG> FileId; //(volume serial number, file ID)
inline
FileId extractFileID(const BY_HANDLE_FILE_INFORMATION& fileInfo)
@@ -41,16 +41,10 @@ FileId extractFileID(DWORD dwVolumeSerialNumber, ULARGE_INTEGER fileId)
FileId(dwVolumeSerialNumber, fileId.QuadPart) : FileId();
}
-namespace impl
-{
-inline
-void validate(const FileId& id, const BY_HANDLE_FILE_INFORMATION& fileInfo)
-{
- assert_static(sizeof(id.second) == sizeof(fileInfo.nFileIndexHigh) + sizeof(fileInfo.nFileIndexLow));
- assert_static(sizeof(id.first ) == sizeof(DWORD));
- assert_static(sizeof(id.second) == sizeof(ULARGE_INTEGER));
-}
-}
+assert_static(sizeof(FileId().first ) == sizeof(BY_HANDLE_FILE_INFORMATION().dwVolumeSerialNumber));
+assert_static(sizeof(FileId().second) == sizeof(BY_HANDLE_FILE_INFORMATION().nFileIndexHigh) + sizeof(BY_HANDLE_FILE_INFORMATION().nFileIndexLow));
+assert_static(sizeof(FileId().second) == sizeof(ULARGE_INTEGER));
+
#elif defined FFS_LINUX
namespace impl { typedef struct ::stat StatDummy; } //sigh...
@@ -58,7 +52,7 @@ namespace impl { typedef struct ::stat StatDummy; } //sigh...
typedef std::pair<decltype(impl::StatDummy::st_dev), decltype(impl::StatDummy::st_ino)> FileId; //(device id, inode)
inline
-FileId extractFileID(const struct stat& fileInfo)
+FileId extractFileID(const struct ::stat& fileInfo)
{
return fileInfo.st_dev != 0 && fileInfo.st_ino != 0 ?
FileId(fileInfo.st_dev, fileInfo.st_ino) : FileId();
bgstack15