patch 8.2.2091: MS-Windows: build warnings
Problem: MS-Windows: build warnings.
Solution: Add a #pragma to suppress the deprecation warning. (Ken Takata)
Avoid using a non-ASCII character. (closes #7421)
diff --git a/src/os_win32.c b/src/os_win32.c
index 21b9b01..2f9ecdc 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -860,6 +860,12 @@
}
#endif
+#ifdef _MSC_VER
+// Suppress the deprecation warning for using GetVersionEx().
+// It is needed for implementing "windowsversion()".
+# pragma warning(push)
+# pragma warning(disable: 4996)
+#endif
/*
* Set "win8_or_later" and fill in "windowsVersion" if possible.
*/
@@ -890,6 +896,9 @@
done = TRUE;
}
}
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL)