Skip to content

Commit 7dca2eb

Browse files
committed
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)
1 parent c854898 commit 7dca2eb

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

src/if_ruby.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,9 @@
6464
# define RUBY_EXPORT
6565
# endif
6666

67-
#if !defined(MSWIN)
68-
# include <dlfcn.h>
69-
# define HINSTANCE void*
70-
# define RUBY_PROC void*
71-
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
72-
# define symbol_from_dll dlsym
73-
# define close_dll dlclose
74-
#else
75-
# define RUBY_PROC FARPROC
76-
# define load_dll vimLoadLib
77-
# define symbol_from_dll GetProcAddress
78-
# define close_dll FreeLibrary
79-
#endif
67+
#endif // ifdef DYNAMIC_RUBY
8068

81-
#endif /* ifdef DYNAMIC_RUBY */
82-
83-
/* suggested by Ariya Mizutani */
69+
// suggested by Ariya Mizutani
8470
#if (_MSC_VER == 1200)
8571
# undef _WIN32_WINNT
8672
#endif
@@ -183,6 +169,22 @@
183169
#include "vim.h"
184170
#include "version.h"
185171

172+
#ifdef DYNAMIC_RUBY
173+
# if !defined(MSWIN) // must come after including vim.h, where it is defined
174+
# include <dlfcn.h>
175+
# define HINSTANCE void*
176+
# define RUBY_PROC void*
177+
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
178+
# define symbol_from_dll dlsym
179+
# define close_dll dlclose
180+
# else
181+
# define RUBY_PROC FARPROC
182+
# define load_dll vimLoadLib
183+
# define symbol_from_dll GetProcAddress
184+
# define close_dll FreeLibrary
185+
# endif
186+
#endif
187+
186188
#if defined(PROTO) && !defined(FEAT_RUBY)
187189
/* Define these to be able to generate the function prototypes. */
188190
# define VALUE int

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ static char *(features[]) =
779779

780780
static int included_patches[] =
781781
{ /* Add new patch number below this line */
782+
/**/
783+
947,
782784
/**/
783785
946,
784786
/**/

0 commit comments

Comments
 (0)