| @@ -131,7 +131,12 @@ static bool isWindowsVersionOrLater (SystemStats::OperatingSystemType target) | |||
| zerostruct (info); | |||
| info.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); | |||
| if (target >= SystemStats::WinVista) | |||
| if (target >= SystemStats::Windows10) | |||
| { | |||
| info.dwMajorVersion = 10; | |||
| info.dwMinorVersion = 0; | |||
| } | |||
| else if (target >= SystemStats::WinVista) | |||
| { | |||
| info.dwMajorVersion = 6; | |||
| @@ -166,7 +171,7 @@ static bool isWindowsVersionOrLater (SystemStats::OperatingSystemType target) | |||
| SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() | |||
| { | |||
| const SystemStats::OperatingSystemType types[] | |||
| = { Windows8_1, Windows8_0, Windows7, WinVista, WinXP, Win2000 }; | |||
| = { Windows10, Windows8_1, Windows8_0, Windows7, WinVista, WinXP, Win2000 }; | |||
| for (int i = 0; i < numElementsInArray (types); ++i) | |||
| if (isWindowsVersionOrLater (types[i])) | |||
| @@ -182,6 +187,7 @@ String SystemStats::getOperatingSystemName() | |||
| switch (getOperatingSystemType()) | |||
| { | |||
| case Windows10: name = "Windows 10"; break; | |||
| case Windows8_1: name = "Windows 8.1"; break; | |||
| case Windows8_0: name = "Windows 8.0"; break; | |||
| case Windows7: name = "Windows 7"; break; | |||
| @@ -47,29 +47,31 @@ public: | |||
| /** The set of possible results of the getOperatingSystemType() method. */ | |||
| enum OperatingSystemType | |||
| { | |||
| UnknownOS = 0, | |||
| Linux = 0x2000, | |||
| Android = 0x3000, | |||
| iOS = 0x8000, | |||
| MacOSX_10_4 = 0x1004, | |||
| MacOSX_10_5 = 0x1005, | |||
| MacOSX_10_6 = 0x1006, | |||
| MacOSX_10_7 = 0x1007, | |||
| MacOSX_10_8 = 0x1008, | |||
| MacOSX_10_9 = 0x1009, | |||
| MacOSX_10_10 = 0x100a, | |||
| Win2000 = 0x4105, | |||
| WinXP = 0x4106, | |||
| WinVista = 0x4107, | |||
| Windows7 = 0x4108, | |||
| Windows8_0 = 0x4109, | |||
| Windows8_1 = 0x410a, | |||
| Windows = 0x4000, /**< To test whether any version of Windows is running, | |||
| you can use the expression ((getOperatingSystemType() & Windows) != 0). */ | |||
| UnknownOS = 0, | |||
| MacOSX = 0x0100, /**< To test whether any version of OSX is running, | |||
| you can use the expression ((getOperatingSystemType() & MacOSX) != 0). */ | |||
| Windows = 0x0200, /**< To test whether any version of Windows is running, | |||
| you can use the expression ((getOperatingSystemType() & Windows) != 0). */ | |||
| Linux = 0x0400, | |||
| Android = 0x0800, | |||
| iOS = 0x1000, | |||
| MacOSX_10_4 = MacOSX | 4, | |||
| MacOSX_10_5 = MacOSX | 5, | |||
| MacOSX_10_6 = MacOSX | 6, | |||
| MacOSX_10_7 = MacOSX | 7, | |||
| MacOSX_10_8 = MacOSX | 8, | |||
| MacOSX_10_9 = MacOSX | 9, | |||
| MacOSX_10_10 = MacOSX | 10, | |||
| Win2000 = Windows | 1, | |||
| WinXP = Windows | 2, | |||
| WinVista = Windows | 3, | |||
| Windows7 = Windows | 4, | |||
| Windows8_0 = Windows | 5, | |||
| Windows8_1 = Windows | 6, | |||
| Windows10 = Windows | 7 | |||
| }; | |||
| /** Returns the type of operating system we're running on. | |||