changeset 15882:8fb7dd311ca7 v8.1.0947

patch 8.1.0947: using MSWIN before it is defined commit https://github.com/vim/vim/commit/7dca2ebbcf508ef2533f1b9f998f7e63c9bbd598 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 18 20:42:50 2019 +0100 patch 8.1.0947: using MSWIN before it is defined Problem: Using MSWIN before it is defined. (Cesar Romani) Solution: Move the block that uses MSWIN to below including vim.h. (Ken Takata)
author Bram Moolenaar <Bram@vim.org>
date Mon, 18 Feb 2019 20:45:06 +0100
parents 32682f423b02
children 756e08173808
files src/if_ruby.c src/version.c
diffstat 2 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -64,23 +64,9 @@
 #  define RUBY_EXPORT
 # endif
 
-#if !defined(MSWIN)
-# include <dlfcn.h>
-# define HINSTANCE void*
-# define RUBY_PROC void*
-# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
-# define symbol_from_dll dlsym
-# define close_dll dlclose
-#else
-# define RUBY_PROC FARPROC
-# define load_dll vimLoadLib
-# define symbol_from_dll GetProcAddress
-# define close_dll FreeLibrary
-#endif
+#endif  // ifdef DYNAMIC_RUBY
 
-#endif  /* ifdef DYNAMIC_RUBY */
-
-/* suggested by Ariya Mizutani */
+// suggested by Ariya Mizutani
 #if (_MSC_VER == 1200)
 # undef _WIN32_WINNT
 #endif
@@ -183,6 +169,22 @@
 #include "vim.h"
 #include "version.h"
 
+#ifdef DYNAMIC_RUBY
+# if !defined(MSWIN)  // must come after including vim.h, where it is defined
+#  include <dlfcn.h>
+#  define HINSTANCE void*
+#  define RUBY_PROC void*
+#  define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
+#  define symbol_from_dll dlsym
+#  define close_dll dlclose
+# else
+#  define RUBY_PROC FARPROC
+#  define load_dll vimLoadLib
+#  define symbol_from_dll GetProcAddress
+#  define close_dll FreeLibrary
+# endif
+#endif
+
 #if defined(PROTO) && !defined(FEAT_RUBY)
 /* Define these to be able to generate the function prototypes. */
 # define VALUE int
--- a/src/version.c
+++ b/src/version.c
@@ -780,6 +780,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    947,
+/**/
     946,
 /**/
     945,