From 04f17d8a377ed258a683878becf2f591beb054e0 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Sun, 2 Mar 2014 10:29:13 +0900 Subject: [PATCH] Bug 978442 - Use WindowsVersion.h from VolatileBuffer. r=mwu --- memory/mozalloc/VolatileBufferWindows.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/memory/mozalloc/VolatileBufferWindows.cpp b/memory/mozalloc/VolatileBufferWindows.cpp index d32aa20c802c..2aba1e2747ff 100644 --- a/memory/mozalloc/VolatileBufferWindows.cpp +++ b/memory/mozalloc/VolatileBufferWindows.cpp @@ -2,13 +2,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#if defined(XP_WIN) || defined(XP_OS2) +#if defined(XP_WIN) # define MOZALLOC_EXPORT __declspec(dllexport) #endif #include "VolatileBuffer.h" #include "mozilla/Assertions.h" #include "mozilla/mozalloc.h" +#include "mozilla/WindowsVersion.h" #include @@ -45,24 +46,7 @@ VolatileBuffer::Init(size_t aSize, size_t aAlignment) goto heap_alloc; } - static bool sCheckedVersion = false; - static bool sUndoSupported = false; - if (!sCheckedVersion) { - OSVERSIONINFOEX verinfo = { 0 }; - verinfo.dwOSVersionInfoSize = sizeof(verinfo); - verinfo.dwMajorVersion = 6; - verinfo.dwMinorVersion = 2; - - DWORDLONG mask = 0; - VER_SET_CONDITION(mask, VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(mask, VER_MINORVERSION, VER_GREATER_EQUAL); - - sUndoSupported = VerifyVersionInfo(&verinfo, - VER_MAJORVERSION | VER_MINORVERSION, - mask); - sCheckedVersion = true; - } - + static bool sUndoSupported = IsWin8OrLater(); if (!sUndoSupported) { goto heap_alloc; }