Mercurial > vim
diff src/if_ruby.c @ 10603:df1abc85b169 v8.0.0191
patch 8.0.0191: can't build with Ruby on some systems
commit https://github.com/vim/vim/commit/4f391796b7de78a434a2cc7107034603df414905
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 15 16:59:07 2017 +0100
patch 8.0.0191: can't build with Ruby on some systems
Problem: Some systems do not have ruby_sysinit(), causing the build to
fail.
Solution: Clean up how ruby_sysinit() and NtInitialize() are used. (Taro
Muraoka)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 15 Jan 2017 17:00:05 +0100 |
parents | dbaad101b1e1 |
children | 721af7a9b4b4 |
line wrap: on
line diff
--- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -303,6 +303,7 @@ static void ruby_vim_init(void); # define ruby_init_loadpath dll_ruby_init_loadpath # ifdef WIN3264 # define NtInitialize dll_NtInitialize +# define ruby_sysinit dll_ruby_sysinit # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 # define rb_w32_snprintf dll_rb_w32_snprintf # endif @@ -405,6 +406,7 @@ static void (*dll_ruby_init) (void); static void (*dll_ruby_init_loadpath) (void); # ifdef WIN3264 static void (*dll_NtInitialize) (int*, char***); +static void (*dll_ruby_sysinit) (int*, char***); # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); # endif @@ -594,13 +596,11 @@ 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", + {"NtInitialize", (RUBY_PROC*)&dll_NtInitialize}, # else - "ruby_sysinit", + {"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit}, # endif - (RUBY_PROC*)&dll_NtInitialize}, # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, # endif