GetOperatingSystemVersion(
unsigned&major,
unsigned&minor,
unsigned&patch)
48NSOperatingSystemVersion versionObj = [NSProcessInfo processInfo].operatingSystemVersion;
50major = (unsigned)versionObj.majorVersion;
51minor = (
unsigned)versionObj.minorVersion;
52patch = (unsigned)versionObj.patchVersion;
83 #if defined(NCBI_OS_MSWIN) 89OSVERSIONINFOEXW osinfo;
90memset(&osinfo, 0,
sizeof(osinfo));
91osinfo.dwOSVersionInfoSize =
sizeof(osinfo);
93 typedefLONG(WINAPI *PRtlGetVersion)(LPOSVERSIONINFOEXW);
94PRtlGetVersion pRtlGetVersion = (PRtlGetVersion)GetProcAddress(GetModuleHandle(TEXT(
"ntdll.dll")),
"RtlGetVersion");
97status = pRtlGetVersion(&osinfo);
100memset(&osinfo, 0,
sizeof(osinfo));
101osinfo.dwOSVersionInfoSize =
sizeof(osinfo);
104 #pragma warning(push) 105 #pragma warning(disable:4996) 107GetVersionExW((LPOSVERSIONINFOW)&osinfo);
114 switch( osinfo.dwMajorVersion ){
123 switch( osinfo.dwMinorVersion ){
143 switch( osinfo.dwMinorVersion ){
161 switch( osinfo.dwMinorVersion ){
165(osinfo.wProductType == VER_NT_WORKSTATION)
173(osinfo.wProductType == VER_NT_WORKSTATION)
180(osinfo.wProductType == VER_NT_WORKSTATION)
187(osinfo.wProductType == VER_NT_WORKSTATION)
196(osinfo.wProductType == VER_NT_WORKSTATION)
207memset(&sysinfo, 0,
sizeof(sysinfo));
209 typedefvoid (WINAPI *PGetSysInfo)(SYSTEM_INFO*);
211PGetSysInfo pGetSysInfo = (PGetSysInfo) GetProcAddress( GetModuleHandle(TEXT(
"kernel32.dll")),
"GetNativeSystemInfo");
212 if( pGetSysInfo !=
NULL){
213pGetSysInfo( &sysinfo );
215GetSystemInfo( &sysinfo );
217 switch( sysinfo.wProcessorArchitecture ){
218 casePROCESSOR_ARCHITECTURE_UNKNOWN:
224 casePROCESSOR_ARCHITECTURE_INTEL:
228 casePROCESSOR_ARCHITECTURE_AMD64:
232 casePROCESSOR_ARCHITECTURE_IA64:
240 #elif defined(NCBI_OS_DARWIN) 249GetOperatingSystemVersion(vers_maj, vers_min, vers_patch);
299 #elif defined(NCBI_OS_UNIX) 373 const char* os_name;
376os_name =
"Windows";
379os_name =
"Windows 95";
382os_name =
"Windows 98";
385os_name =
"Windows ME";
388os_name =
"Windows NT 3.51";
391os_name =
"Windows NT 4.0";
394os_name =
"Windows 2000";
397os_name =
"Windows XP";
400os_name =
"Windows 2003";
403os_name =
"Windows 2003 R2";
406os_name =
"Windows Vista";
409os_name =
"Windows 2008";
412os_name =
"Windows 2008 R2";
415os_name =
"Windows 7";
418os_name =
"Windows Server 2012";
421os_name =
"Windows 8.0";
424os_name =
"Windows Server 2012 R2";
427os_name =
"Windows 8.1";
430os_name =
"Windows Server 2016";
433os_name =
"Windows 10";
436os_name =
"MacOS X";
439os_name =
"MacOS X 10.1";
442os_name =
"MacOS X 10.2";
445os_name =
"MacOS X 10.3";
448os_name =
"MacOS X 10.4";
451os_name =
"MacOS X 10.5";
454os_name =
"MacOS X 10.6";
457os_name =
"MacOS X 10.7";
460os_name =
"MacOS X 10.8 Mountain Lion";
463os_name =
"MacOS X 10.9 Mavericks";
466os_name =
"MacOS X 10.10 Yosemite";
469os_name =
"MacOS X 10.11 El Capitan";
472os_name =
"MacOS X 10.12 Sierra";
475os_name =
"MacOS X 10.13 High Sierra";
478os_name =
"MacOS X 10.14 Mojave";
481os_name =
"MacOS X 10.15 Catalina";
488os_name =
"Unix/Linux";
491os_name =
"Unix/Solaris 9";
494os_name =
"Unix/Solaris 10";
499os_name =
"Windows";
501os_name =
"MacOS X";
505os_name =
"Unknown";
510 const char* arch_name =
"";
513arch_name =
" Intel-x32";
516arch_name =
" AMD-x64";
519arch_name =
" Intel-x64";
522arch_name =
" PowerPC";
525arch_name =
" Sparc";
528arch_name =
" MIPS";
531arch_name =
" Alpha";
bool operator<(const CGBenchVersionInfo &v1, const CGBenchVersionInfo &v2)
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CTime AsCTime(CTime::ETimeZone tz=CTime::eLocal) const
void GetOsString(string *str) const
void AddOsString(string *str) const
void GetVersionString(string *str) const
retrieve just the version info
static void Initialize(size_t ver_major, size_t ver_minor, size_t ver_patch_level)
Forced to make this method public as far as friend declaration does not work on Linux.
void AddVersionString(string *str) const
void GetLabel(string *str) const
Format a label for this version.
~CGBenchVersionInfo(void)
static const char * str(char *buf, int n)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
TVer_major GetVer_major(void) const
Get the Ver_major member data.
TVer_minor & SetVer_minor(void)
Assign a value to Ver_minor data member.
const TBuild_date & GetBuild_date(void) const
Get the Build_date member data.
TVer_major & SetVer_major(void)
Assign a value to Ver_major data member.
TVer_patch & SetVer_patch(void)
Assign a value to Ver_patch data member.
TOs_ver & SetOs_ver(void)
Assign a value to Os_ver data member.
TVer_minor GetVer_minor(void) const
Get the Ver_minor member data.
TVer_patch GetVer_patch(void) const
Get the Ver_patch member data.
bool IsSetBuild_date(void) const
Check if a value has been assigned to Build_date data member.
TOs_ver GetOs_ver(void) const
Get the Os_ver member data.
@ eOS_Ver_cpu_generic
CPU attributes general mask (0xff000000)
@ eOS_Ver_ppc
any powerpc (0x04000000)
@ eOS_Ver_windows_nt4
0x5
@ eOS_Ver_sparc
any sparc (0x05000000)
@ eOS_Ver_macosx_10_7
0x700
@ eOS_Ver_intel_x64
any intel x64 (0x03000000)
@ eOS_Ver_macosx_10_15
0xF00
@ eOS_Ver_windows_2003
0x8
@ eOS_Ver_windows_2008
0xb
@ eOS_Ver_macosx_10_9
0x900
@ eOS_Ver_alpha
any alpha (0x07000000)
@ eOS_Ver_amd_x64
any amd x64 (0x02000000)
@ eOS_Ver_windows_generic
bitmaks covering all Windows versions this corresponds to 0xff
@ eOS_Ver_unix_solaris_9
0x20000
@ eOS_Ver_unix_generic
bitmask for all linux and unix flavors this corresponds to 0xff0000
@ eOS_Ver_mips
any mips (0x06000000)
@ eOS_Ver_macosx_generic
bitmask covering all MacOS X versions this corresponds to 0xff00
@ eOS_Ver_macosx_10_14
0xE00
@ eOS_Ver_unix_solaris_10
0x30000
@ eOS_Ver_macosx_10_2
0x200
@ eOS_Ver_windows_2000
0x6
@ eOS_Ver_windows_eight
0xf
@ eOS_Ver_macosx_10_6
0x600
@ eOS_Ver_macosx_10_3
0x300
@ eOS_Ver_windows_seven
0xd
@ eOS_Ver_windows_2016
0x12
@ eOS_Ver_macosx_10_1
specific MacOS X versions 0x100
@ eOS_Ver_macosx_10_11
0xB00
@ eOS_Ver_windows_95
specific windows versions 0x1
@ eOS_Ver_macosx_10_8
0x800
@ eOS_Ver_macosx_10_13
0xD00
@ eOS_Ver_macosx_10_4
0x400
@ eOS_Ver_windows_eight_one
0x11
@ eOS_Ver_macosx_10_5
0x500
@ eOS_Ver_windows_vista
0xa
@ eOS_Ver_windows_ten
0x13
@ eOS_Ver_windows_2012_R2
0x10
@ eOS_Ver_macosx_10_12
0xC00
@ eOS_Ver_unix_linux
specific supported versions 0x10000
@ eOS_Ver_windows_2012
0xe
@ eOS_Ver_windows_2003_R2
0x9
@ eOS_Ver_windows_2008_R2
0xc
@ eOS_Ver_macosx_10_10
0xA00
@ eOS_Ver_windows_351
0x4
@ eOS_Ver_intel_x32
any intel x32 (0x01000000)
unsigned int
A callback function used to compare two keys in a database.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4