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
This commit is contained in:
Aaron Klotz 2019-12-05 21:52:51 +00:00
Родитель 21f179a116
Коммит c15ae2a867
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -526,6 +526,8 @@ inline UniquePtr<wchar_t[]> GetFullBinaryPath() {
class ModuleVersion final { class ModuleVersion final {
public: public:
constexpr ModuleVersion() : mVersion(0ULL) {}
explicit ModuleVersion(const VS_FIXEDFILEINFO& aFixedInfo) explicit ModuleVersion(const VS_FIXEDFILEINFO& aFixedInfo)
: mVersion((static_cast<uint64_t>(aFixedInfo.dwFileVersionMS) << 32) | : mVersion((static_cast<uint64_t>(aFixedInfo.dwFileVersionMS) << 32) |
static_cast<uint64_t>(aFixedInfo.dwFileVersionLS)) {} static_cast<uint64_t>(aFixedInfo.dwFileVersionLS)) {}
@ -555,6 +557,11 @@ class ModuleVersion final {
bool operator<(const uint64_t& aOther) const { return mVersion < aOther; } bool operator<(const uint64_t& aOther) const { return mVersion < aOther; }
ModuleVersion& operator=(const uint64_t aIntVersion) {
mVersion = aIntVersion;
return *this;
}
private: private:
uint64_t mVersion; uint64_t mVersion;
}; };