diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-12 21:15:43 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-12 21:15:43 +0100 |
commit | 2f189750887636fecd440d7ef353d9224e48713f (patch) | |
tree | 83c7cad211df84723e00796ee033739fbccd78c1 /src | |
parent | 3b0ef8cfdbb6cb5a9cb2dc093132b78d7a52c667 (diff) |
patch 8.2.0248: MS-Windows: dealing with deprecation is too complicatedv8.2.0248
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/Make_mvc.mak | 9 | ||||
-rw-r--r-- | src/dosinst.h | 8 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim.h | 2 | ||||
-rw-r--r-- | src/vimio.h | 13 | ||||
-rw-r--r-- | src/winclip.c | 1 |
6 files changed, 10 insertions, 25 deletions
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 509708167e..b95e936f06 100644 --- 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 @@ $(VIM): $(VIM).exe $(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 diff --git a/src/dosinst.h b/src/dosinst.h index c9d8c929bf..a849dad907 100644 --- a/src/dosinst.h +++ b/src/dosinst.h @@ -10,12 +10,6 @@ * dosinst.h: Common code for dosinst.c and uninstall.c */ -// Visual Studio 2005 has 'deprecated' many of the standard CRT functions -#if _MSC_VER >= 1400 -# define _CRT_SECURE_NO_DEPRECATE -# define _CRT_NONSTDC_NO_DEPRECATE -#endif - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -23,7 +17,7 @@ #include <fcntl.h> #ifndef UNIX_LINT -# include "vimio.h" +# include <io.h> # include <ctype.h> # include <direct.h> diff --git a/src/version.c b/src/version.c index 1b22d6ffa2..ba79618268 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 248, +/**/ 247, /**/ 246, @@ -18,7 +18,7 @@ #endif #ifdef MSWIN -# include "vimio.h" +# include <io.h> #endif // ============ the header file puzzle: order matters ========= diff --git a/src/vimio.h b/src/vimio.h deleted file mode 100644 index a07620ca71..0000000000 --- a/src/vimio.h +++ /dev/null @@ -1,13 +0,0 @@ -/* vi:set ts=8 sts=4 sw=4 noet: - * - * VIM - Vi IMproved by Bram Moolenaar - * - * Do ":help uganda" in Vim to read copying and usage conditions. - * Do ":help credits" in Vim to see a list of people who contributed. - * See README.txt for an overview of the Vim source code. - */ - -// cproto fails on missing include files -#ifndef PROTO -# include <io.h> -#endif diff --git a/src/winclip.c b/src/winclip.c index d97f776ca8..767bf1c71e 100644 --- a/src/winclip.c +++ b/src/winclip.c @@ -14,7 +14,6 @@ * Also used by Cygwin, using os_unix.c. */ -#include "vimio.h" #include "vim.h" /* |