From c15ae2a8673433d98ab27cf879b7b027947fe137 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Thu, 5 Dec 2019 21:52:51 +0000 Subject: [PATCH] Bug 1522830: Part 4 - Add constexpr constructor and assignment operator from uint64_t to ModuleVersion; r=mhowell Differential Revision: https://phabricator.services.mozilla.com/D53676 --HG-- extra : moz-landing-system : lando --- widget/windows/WinHeaderOnlyUtils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/widget/windows/WinHeaderOnlyUtils.h b/widget/windows/WinHeaderOnlyUtils.h index 78053e1cd8f5..c97eaa3e1224 100644 --- a/widget/windows/WinHeaderOnlyUtils.h +++ b/widget/windows/WinHeaderOnlyUtils.h @@ -526,6 +526,8 @@ inline UniquePtr GetFullBinaryPath() { class ModuleVersion final { public: + constexpr ModuleVersion() : mVersion(0ULL) {} + explicit ModuleVersion(const VS_FIXEDFILEINFO& aFixedInfo) : mVersion((static_cast(aFixedInfo.dwFileVersionMS) << 32) | static_cast(aFixedInfo.dwFileVersionLS)) {} @@ -555,6 +557,11 @@ class ModuleVersion final { bool operator<(const uint64_t& aOther) const { return mVersion < aOther; } + ModuleVersion& operator=(const uint64_t aIntVersion) { + mVersion = aIntVersion; + return *this; + } + private: uint64_t mVersion; };