summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-18 20:42:50 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-18 20:42:50 +0100
commit7dca2ebbcf508ef2533f1b9f998f7e63c9bbd598 (patch)
tree7d5b47acb99bceffe5dbceb3ff00ef26d9448546 /src/if_ruby.c
parentc854898881c02259f90170f210bf65bbd20cc1fc (diff)
downloadvim-git-7dca2ebbcf508ef2533f1b9f998f7e63c9bbd598.tar.gz
patch 8.1.0947: using MSWIN before it is definedv8.1.0947
Problem: Using MSWIN before it is defined. (Cesar Romani) Solution: Move the block that uses MSWIN to below including vim.h. (Ken Takata)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 85f94c4f0..d3ed78128 100644
--- 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