Changeset 3394 for trunk/src/kmk/variable.c
- Timestamp:
- Jul 1, 2020, 10:24:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/variable.c
r3319 r3394 1606 1606 struct variable *envvar1; 1607 1607 struct variable *envvar2; 1608 # ifdef WINDOWS32 1609 OSVERSIONINFOEX oix; 1610 # else 1608 # ifndef WINDOWS32 1611 1609 struct utsname uts; 1612 1610 # endif … … 1677 1675 1678 1676 /* The host kernel version. */ 1679 #if defined(WINDOWS32) 1680 memset (&oix, '\0', sizeof (oix)); 1681 oix.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); 1682 if (!GetVersionEx ((LPOSVERSIONINFO)&oix)) 1683 { 1684 memset (&oix, '\0', sizeof (oix)); 1685 oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); 1686 GetVersionEx ((LPOSVERSIONINFO)&oix); 1687 } 1688 if (oix.dwPlatformId == VER_PLATFORM_WIN32_NT) 1689 { 1690 ulMajor = oix.dwMajorVersion; 1691 ulMinor = oix.dwMinorVersion; 1692 ulPatch = oix.wServicePackMajor; 1693 ul4th = oix.wServicePackMinor; 1694 } 1695 else 1696 { 1697 ulMajor = oix.dwPlatformId == 1 ? 0 /*Win95/98/ME*/ 1698 : oix.dwPlatformId == 3 ? 1 /*WinCE*/ 1699 : 2; /*??*/ 1700 ulMinor = oix.dwMajorVersion; 1701 ulPatch = oix.dwMinorVersion; 1702 ul4th = oix.wServicePackMajor; 1703 } 1704 #else 1677 # if defined(WINDOWS32) 1678 { 1679 OSVERSIONINFOEXW oix; 1680 typedef NTSTATUS (WINAPI *pfnRtlGetVersion)(OSVERSIONINFOEXW *); 1681 *(FARPROC *)&pfnRtlGetVersion = GetProcAddress (GetModuleHandleW ("NTDLL.DLL"), 1682 "RtlGetVersion"); /* GetVersionEx lies */ 1683 memset (&oix, '\0', sizeof (oix)); 1684 oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); 1685 if (!pfnRtlGetVersion || pfnRtlGetVersion (&oix) < 0) 1686 { 1687 memset (&oix, '\0', sizeof (oix)); 1688 oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); 1689 if (!GetVersionExW((LPOSVERSIONINFO)&oix)) 1690 { 1691 memset (&oix, '\0', sizeof (oix)); 1692 oix.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); 1693 GetVersionExW ((LPOSVERSIONINFO)&oix); 1694 } 1695 } 1696 if (oix.dwPlatformId == VER_PLATFORM_WIN32_NT) 1697 { 1698 ulMajor = oix.dwMajorVersion; 1699 ulMinor = oix.dwMinorVersion; 1700 ulPatch = oix.wServicePackMajor; 1701 ul4th = oix.wServicePackMinor; 1702 } 1703 else 1704 { 1705 ulMajor = oix.dwPlatformId == 1 ? 0 /*Win95/98/ME*/ 1706 : oix.dwPlatformId == 3 ? 1 /*WinCE*/ 1707 : 2; /*??*/ 1708 ulMinor = oix.dwMajorVersion; 1709 ulPatch = oix.dwMinorVersion; 1710 ul4th = oix.wServicePackMajor; 1711 } 1712 } 1713 # else 1705 1714 memset (&uts, 0, sizeof(uts)); 1706 1715 uname (&uts); … … 1716 1725 define_variable_cname ("KBUILD_HOST_UNAME_MACHINE", uts.machine, o_default, 0); 1717 1726 define_variable_cname ("KBUILD_HOST_UNAME_NODENAME", uts.nodename, o_default, 0); 1718 # endif1727 # endif 1719 1728 1720 1729 sprintf (buf, "%lu.%lu.%lu.%lu", ulMajor, ulMinor, ulPatch, ul4th); … … 1765 1774 && defined (KMK_HELPERS) 1766 1775 define_variable_cname ("KMK_FEATURES", 1767 "append-dash-n abspath includedep-queue install-hard-linking umask quote "1776 "append-dash-n abspath includedep-queue install-hard-linking umask quote versort" 1768 1777 " kBuild-define" 1769 1778 " rsort" … … 1796 1805 # else /* MSC can't deal with strings mixed with #if/#endif, thus the slow way. */ 1797 1806 # error "All features should be enabled by default!" 1798 strcpy (buf, "append-dash-n abspath includedep-queue install-hard-linking umask quote "1807 strcpy (buf, "append-dash-n abspath includedep-queue install-hard-linking umask quote versort" 1799 1808 " kBuild-define"); 1800 1809 # if defined (CONFIG_WITH_RSORT)
Note:
See TracChangeset
for help on using the changeset viewer.