diff src/Make_mvc.mak @ 19380:1e78bf92f168 v8.2.0248

patch 8.2.0248: MS-Windows: dealing with deprecation is too complicated Commit: https://github.com/vim/vim/commit/2f189750887636fecd440d7ef353d9224e48713f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 12 21:15:43 2020 +0100 patch 8.2.0248: MS-Windows: dealing with deprecation is too complicated Problem: MS-Windows: dealing with deprecation is too complicated. Solution: Use io.h directly. Move _CRT_SECURE_NO_DEPRECATE to the build file. Suppress C4091 warning by setting "_WIN32_WINNT". (Ken Takata, closes #5626)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Feb 2020 21:30:03 +0100
parents 1cae476a7c82
children e6f0b4fe0b6d
line wrap: on
line diff
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -658,7 +658,8 @@ OPTFLAG = /Ox
 OPTFLAG = $(OPTFLAG) /GL
 !  endif
 # Visual Studio 2005 has 'deprecated' many of the standard CRT functions
-CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
+CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
+CFLAGS = $(CFLAGS) $(CFLAGS_DEPR)
 ! endif
 
 # (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
@@ -1348,15 +1349,17 @@ all:	$(MAIN_TARGET) \
 $(OUTDIR):
 	if not exist $(OUTDIR)/nul  mkdir $(OUTDIR)
 
+CFLAGS_INST = /nologo -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR)
+
 install.exe: dosinst.c dosinst.h version.h
-	$(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
+	$(CC) $(CFLAGS_INST) dosinst.c kernel32.lib shell32.lib \
 		user32.lib ole32.lib advapi32.lib uuid.lib \
 		-link -subsystem:$(SUBSYSTEM_TOOLS)
 	- if exist install.exe del install.exe
 	ren dosinst.exe install.exe
 
 uninstall.exe: uninstall.c dosinst.h version.h
-	$(CC) /nologo -DNDEBUG -DWIN32 uninstall.c shell32.lib advapi32.lib \
+	$(CC) $(CFLAGS_INST) uninstall.c shell32.lib advapi32.lib \
 		-link -subsystem:$(SUBSYSTEM_TOOLS)
 
 vimrun.exe: vimrun.c