From bc04ded9d6ee9cfbcea072cddb837f5e522051bd Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Thu, 2 Dec 2021 20:40:55 -0800
Subject: [PATCH] Work around GetVersionEx deprecation warning/error

For some reason this deprecation warning is being treated as an error (and only with newer Windows platform SDKs). Just disable this warning for the GetVersionEx line.
See https://stackoverflow.com/questions/22303824/warning-c4996-getversionexw-was-declared-deprecated for details.
---
 src/xpdev/genwrap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/xpdev/genwrap.c b/src/xpdev/genwrap.c
index 8fb8a71224..31b53f50cf 100644
--- a/src/xpdev/genwrap.c
+++ b/src/xpdev/genwrap.c
@@ -1,8 +1,5 @@
 /* General cross-platform development wrappers */
 
-/* $Id: genwrap.c,v 1.118 2020/08/10 04:11:44 rswindell Exp $ */
-// vi: tabstop=4
-
 /****************************************************************************
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
@@ -35,7 +32,7 @@
  ****************************************************************************/
 
 #include <string.h>     /* strlen() */
-#include <stdarg.h>	/* vsnprintf() */
+#include <stdarg.h>		/* vsnprintf() */
 #include <stdlib.h>		/* RAND_MAX */
 #include <fcntl.h>		/* O_NOCTTY */
 #include <time.h>		/* clock() */
@@ -622,6 +619,7 @@ char* os_version(char *str)
 	OSVERSIONINFO	winver;
 
 	winver.dwOSVersionInfoSize=sizeof(winver);
+	#pragma warning(suppress : 4996)
 	GetVersionEx(&winver);
 
 	switch(winver.dwPlatformId) {
-- 
GitLab