comparison src/os_win32.c @ 18973:bf8eb950df61 v8.2.0047

patch 8.2.0047: cannot skip tests for specific MS-Windows platform Commit: https://github.com/vim/vim/commit/0c1e3744ff0cd6c17af773046b876b428ff3dded Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 27 13:49:24 2019 +0100 patch 8.2.0047: cannot skip tests for specific MS-Windows platform Problem: Cannot skip tests for specific MS-Windows platform. Solution: Add windowsversion().
author Bram Moolenaar <Bram@vim.org>
date Fri, 27 Dec 2019 14:00:04 +0100
parents 44906eff69f9
children 2ef19eed524a
comparison
equal deleted inserted replaced
18972:130acb903dbe 18973:bf8eb950df61
756 756
757 #ifndef VER_PLATFORM_WIN32_WINDOWS 757 #ifndef VER_PLATFORM_WIN32_WINDOWS
758 # define VER_PLATFORM_WIN32_WINDOWS 1 758 # define VER_PLATFORM_WIN32_WINDOWS 1
759 #endif 759 #endif
760 760
761 DWORD g_PlatformId;
762
763 #ifdef HAVE_ACL 761 #ifdef HAVE_ACL
764 # ifndef PROTO 762 # ifndef PROTO
765 # include <aclapi.h> 763 # include <aclapi.h>
766 # endif 764 # endif
767 # ifndef PROTECTED_DACL_SECURITY_INFORMATION 765 # ifndef PROTECTED_DACL_SECURITY_INFORMATION
804 return bResult && GetLastError() == ERROR_SUCCESS; 802 return bResult && GetLastError() == ERROR_SUCCESS;
805 } 803 }
806 #endif 804 #endif
807 805
808 /* 806 /*
809 * Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or 807 * Set "win8_or_later" and fill in "windowsVersion".
810 * VER_PLATFORM_WIN32_WINDOWS (Win95).
811 */ 808 */
812 void 809 void
813 PlatformId(void) 810 PlatformId(void)
814 { 811 {
815 static int done = FALSE; 812 static int done = FALSE;
819 OSVERSIONINFO ovi; 816 OSVERSIONINFO ovi;
820 817
821 ovi.dwOSVersionInfoSize = sizeof(ovi); 818 ovi.dwOSVersionInfoSize = sizeof(ovi);
822 GetVersionEx(&ovi); 819 GetVersionEx(&ovi);
823 820
824 g_PlatformId = ovi.dwPlatformId; 821 vim_snprintf(windowsVersion, sizeof(windowsVersion), "%d.%d",
822 (int)ovi.dwMajorVersion, (int)ovi.dwMinorVersion);
825 823
826 if ((ovi.dwMajorVersion == 6 && ovi.dwMinorVersion >= 2) 824 if ((ovi.dwMajorVersion == 6 && ovi.dwMinorVersion >= 2)
827 || ovi.dwMajorVersion > 6) 825 || ovi.dwMajorVersion > 6)
828 win8_or_later = TRUE; 826 win8_or_later = TRUE;
829 827