Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: Source/platform/win/SystemInfo.cpp

Issue 39693002: Introduce isWindowsVistaOrGreater() as replacement of windowsVersion() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 { 34 {
35 static bool initialized = false; 35 static bool initialized = false;
36 static WindowsVersion version; 36 static WindowsVersion version;
37 static int majorVersion, minorVersion; 37 static int majorVersion, minorVersion;
38 38
39 if (!initialized) { 39 if (!initialized) {
40 initialized = true; 40 initialized = true;
41 OSVERSIONINFOEX versionInfo; 41 OSVERSIONINFOEX versionInfo;
42 ZeroMemory(&versionInfo, sizeof(versionInfo)); 42 ZeroMemory(&versionInfo, sizeof(versionInfo));
43 versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); 43 versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
44 #ifdef _WIN32_WINNT_WINBLUE
45 // Since Win SDK 8.1, GetVersionEx() is deprecated.
46 #pragma warning(push)
47 #pragma warning(disable: 4996)
48 #endif
44 GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo)); 49 GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo));
yukawa 2013/10/24 11:35:38 Just FYI, you can also suppress warning only in on
50 #ifdef _WIN32_WINNT_WINBLUE
51 #pragma warning(pop)
52 #endif
45 majorVersion = versionInfo.dwMajorVersion; 53 majorVersion = versionInfo.dwMajorVersion;
46 minorVersion = versionInfo.dwMinorVersion; 54 minorVersion = versionInfo.dwMinorVersion;
47 55
48 if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32s) { 56 if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32s) {
49 version = Windows3_1; 57 version = Windows3_1;
50 } else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { 58 } else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
51 if (!minorVersion) 59 if (!minorVersion)
52 version = Windows95; 60 version = Windows95;
53 else 61 else
54 version = (minorVersion == 10) ? Windows98 : WindowsME; 62 version = (minorVersion == 10) ? Windows98 : WindowsME;
(...skipping 15 matching lines...) Expand all
70 } 78 }
71 79
72 if (major) 80 if (major)
73 *major = majorVersion; 81 *major = majorVersion;
74 if (minor) 82 if (minor)
75 *minor = minorVersion; 83 *minor = minorVersion;
76 return version; 84 return version;
77 } 85 }
78 86
79 } // namespace WebCore 87 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698