]> granicus.if.org Git - vim/commitdiff
patch 8.2.0246: MSVC: deprecation warnings with Ruby v8.2.0246
authorBram Moolenaar <Bram@vim.org>
Tue, 11 Feb 2020 22:01:39 +0000 (23:01 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 11 Feb 2020 22:01:39 +0000 (23:01 +0100)
Problem:    MSVC: deprecation warnings with Ruby.
Solution:   Move _CRT_SECURE_NO_DEPRECATE to build file. (Ken Takata,
            closes #5622)

src/Make_mvc.mak
src/if_ruby.c
src/os_win32.h
src/version.c
src/vim.h
src/vimio.h

index c51f8045a7e3fe39cd8cb07f3ec7b07f3f31b010..509708167e23efcc295fb6f77103d51a04168770 100644 (file)
@@ -657,6 +657,8 @@ OPTFLAG = /Ox
 !  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.)
index 7f2a7d265e19d35e6fa5272ba6b8d587d5f0df74..f4e1e12394aa85913da96e13688b95d35c1cabaf 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifdef _WIN32
 # if !defined(DYNAMIC_RUBY) || (RUBY_VERSION < 18)
-#   define NT
+#  define NT
 # endif
 # ifndef DYNAMIC_RUBY
 #  define IMPORT // For static dll usage __declspec(dllimport)
@@ -300,8 +300,8 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
 #  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
+#   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,15 +1071,15 @@ error_print(int state)
            }
 
            attr = syn_name2attr((char_u *)"Error");
-# if RUBY_VERSION >= 21
+#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
+#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
+#endif
            break;
        default:
            vim_snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state);
index f1be8c44112ed644f10c3bee967057b95e492678..abe95b5fe32a5f4f745603ce6d231f3e944f4d6e 100644 (file)
 # 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
index 8e3f20a4833055e0a04fdf0e6f84ddad6ea6e92a..b3f95134c9582c7cacae7a532f1bb257320d39c2 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    246,
 /**/
     245,
 /**/
index 270109ace94bc7ed7a3f84e3babc45dc11d2f95d..ca0f6b1484c9a47e468d0b497e0050a36940b8f9 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
 # 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.
index 402b11381a4369765ed8c0e5e6a4056db0522780..a07620ca7112a6171365365a20bfe74dc18a2179 100644 (file)
@@ -7,12 +7,6 @@
  * 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 <io.h>