summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-19 20:48:46 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-19 20:48:46 +0100
commit9d5c84a08f0574e680ef61d7e44e981bd6be741d (patch)
treea21ff998385d91010f872538509b44c4e650f8dc /src/if_ruby.c
parente66777901382a554797a4c70ffbc0c63440cfe57 (diff)
downloadvim-git-9d5c84a08f0574e680ef61d7e44e981bd6be741d.tar.gz
patch 8.1.0609: MS-Windows: unused variable, depending on the Ruby versionv8.1.0609
Problem: MS-Windows: unused variable, depending on the Ruby version. Solution: Put ruby_sysinit and NtInitialize inside #ifdef and make them consistent. (Ken Takata)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 5180ed8d0..cb9b41603 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -326,8 +326,11 @@ static void ruby_vim_init(void);
# define ruby_init dll_ruby_init
# define ruby_init_loadpath dll_ruby_init_loadpath
# ifdef WIN3264
-# define NtInitialize dll_NtInitialize
-# define ruby_sysinit dll_ruby_sysinit
+# ifdef RUBY19_OR_LATER
+# define ruby_sysinit dll_ruby_sysinit
+# else
+# define NtInitialize dll_NtInitialize
+# endif
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
# define rb_w32_snprintf dll_rb_w32_snprintf
# endif
@@ -437,8 +440,11 @@ static VALUE *dll_ruby_errinfo;
static void (*dll_ruby_init) (void);
static void (*dll_ruby_init_loadpath) (void);
# ifdef WIN3264
-static void (*dll_NtInitialize) (int*, char***);
+# ifdef RUBY19_OR_LATER
static void (*dll_ruby_sysinit) (int*, char***);
+# else
+static void (*dll_NtInitialize) (int*, char***);
+# endif
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
# endif
@@ -637,10 +643,10 @@ static struct
{"ruby_init", (RUBY_PROC*)&dll_ruby_init},
{"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
# ifdef WIN3264
-# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
- {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
-# else
+# ifdef RUBY19_OR_LATER
{"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit},
+# else
+ {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
# endif
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
{"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},