To: vim_dev@googlegroups.com Subject: Patch 8.2.0246 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0246 Problem: MSVC: deprecation warnings with Ruby. Solution: Move _CRT_SECURE_NO_DEPRECATE to build file. (Ken Takata, closes #5622) Files: src/Make_mvc.mak, src/if_ruby.c, src/os_win32.h, src/vim.h, src/vimio.h *** ../vim-8.2.0245/src/Make_mvc.mak 2020-02-11 22:49:15.203589858 +0100 --- src/Make_mvc.mak 2020-02-11 22:59:08.824089285 +0100 *************** *** 657,662 **** --- 657,664 ---- ! if "$(OPTIMIZE)" != "SPACE" 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 ! endif # (/Wp64 is deprecated in VC9 and generates an obnoxious warning.) *** ../vim-8.2.0245/src/if_ruby.c 2020-01-11 16:05:19.590287629 +0100 --- src/if_ruby.c 2020-02-11 22:59:08.824089285 +0100 *************** *** 21,27 **** #ifdef _WIN32 # if !defined(DYNAMIC_RUBY) || (RUBY_VERSION < 18) ! # define NT # endif # ifndef DYNAMIC_RUBY # define IMPORT // For static dll usage __declspec(dllimport) --- 21,27 ---- #ifdef _WIN32 # if !defined(DYNAMIC_RUBY) || (RUBY_VERSION < 18) ! # define NT # endif # ifndef DYNAMIC_RUBY # define IMPORT // For static dll usage __declspec(dllimport) *************** *** 300,307 **** # define rb_float_new dll_rb_float_new # define rb_ary_new dll_rb_ary_new # ifdef rb_ary_new4 ! # define RB_ARY_NEW4_MACRO 1 ! # undef rb_ary_new4 # endif # define rb_ary_new4 dll_rb_ary_new4 # define rb_ary_push dll_rb_ary_push --- 300,307 ---- # define rb_float_new dll_rb_float_new # define rb_ary_new dll_rb_ary_new # ifdef rb_ary_new4 ! # define RB_ARY_NEW4_MACRO 1 ! # undef rb_ary_new4 # endif # define rb_ary_new4 dll_rb_ary_new4 # define rb_ary_push dll_rb_ary_push *************** *** 1071,1085 **** } attr = syn_name2attr((char_u *)"Error"); ! # if RUBY_VERSION >= 21 bt = rb_funcallv(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) msg_attr(RSTRING_PTR(RARRAY_AREF(bt, i)), attr); ! # else bt = rb_funcall2(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) msg_attr(RSTRING_PTR(RARRAY_PTR(bt)[i]), attr); ! # endif break; default: vim_snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state); --- 1071,1085 ---- } attr = syn_name2attr((char_u *)"Error"); ! #if RUBY_VERSION >= 21 bt = rb_funcallv(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) msg_attr(RSTRING_PTR(RARRAY_AREF(bt, i)), attr); ! #else bt = rb_funcall2(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) msg_attr(RSTRING_PTR(RARRAY_PTR(bt)[i]), attr); ! #endif break; default: vim_snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state); *** ../vim-8.2.0245/src/os_win32.h 2019-11-30 18:53:27.000000000 +0100 --- src/os_win32.h 2020-02-11 22:59:08.824089285 +0100 *************** *** 18,29 **** # endif #endif - // Stop the VC2005 compiler from nagging. - #if _MSC_VER >= 1400 - # define _CRT_SECURE_NO_DEPRECATE - # define _CRT_NONSTDC_NO_DEPRECATE - #endif - #define BINARY_FILE_IO #define USE_EXE_NAME // use argv[0] for $VIM #define USE_TERM_CONSOLE --- 18,23 ---- *** ../vim-8.2.0245/src/vim.h 2020-02-10 22:44:29.088282843 +0100 --- src/vim.h 2020-02-11 22:59:08.824089285 +0100 *************** *** 119,130 **** # endif #endif - // 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 - /* * VIM_SIZEOF_INT is used in feature.h, and the system-specific included files * need items from feature.h. Therefore define VIM_SIZEOF_INT here. --- 119,124 ---- *** ../vim-8.2.0245/src/vimio.h 2019-11-30 18:57:27.000000000 +0100 --- src/vimio.h 2020-02-11 22:59:08.824089285 +0100 *************** *** 7,18 **** * See README.txt for an overview of the Vim source code. */ - // 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 - // cproto fails on missing include files #ifndef PROTO # include --- 7,12 ---- *** ../vim-8.2.0245/src/version.c 2020-02-11 22:49:15.203589858 +0100 --- src/version.c 2020-02-11 23:00:55.207510347 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 246, /**/ -- Creating the world with Emacs: M-x let-there-be-light Creating the world with Vim: :make world /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///