summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-28 21:11:06 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-28 21:11:06 +0200
commitd057301b1f28736f094affa17b190244ad56e8d9 (patch)
treeae20801354321a5ff0d7d23b04d8d6018c57645a /src/if_ruby.c
parentef83956e1e67736b4c6b886d897b74f022622a74 (diff)
downloadvim-git-d057301b1f28736f094affa17b190244ad56e8d9.tar.gz
patch 8.0.1236: Mac features are confusingv8.0.1236
Problem: Mac features are confusing. Solution: Make feature names more consistent, add "osxdarwin". Rename feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes #2178)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index f3434a95b..ca31c1a05 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -127,7 +127,7 @@
#undef _
/* T_DATA defined both by Ruby and Mac header files, hack around it... */
-#if defined(MACOS_X_UNIX) || defined(macintosh)
+#if defined(MACOS_X)
# define __OPENTRANSPORT__
# define __OPENTRANSPORTPROTOCOL__
# define __OPENTRANSPORTPROVIDERS__
@@ -251,7 +251,8 @@ static void ruby_vim_init(void);
# endif
# define rb_lastline_get dll_rb_lastline_get
# define rb_lastline_set dll_rb_lastline_set
-# define rb_load_protect dll_rb_load_protect
+# define rb_protect dll_rb_protect
+# define rb_load dll_rb_load
# ifndef RUBY19_OR_LATER
# define rb_num2long dll_rb_num2long
# endif
@@ -376,7 +377,8 @@ static unsigned long (*dll_rb_num2uint) (VALUE);
# endif
static VALUE (*dll_rb_lastline_get) (void);
static void (*dll_rb_lastline_set) (VALUE);
-static void (*dll_rb_load_protect) (VALUE, int, int*);
+static void (*dll_rb_protect) (VALUE (*)(VALUE), int, int*);
+static void (*dll_rb_load) (VALUE, int);
static long (*dll_rb_num2long) (VALUE);
static unsigned long (*dll_rb_num2ulong) (VALUE);
static VALUE (*dll_rb_obj_alloc) (VALUE);
@@ -568,7 +570,8 @@ static struct
# endif
{"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get},
{"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set},
- {"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect},
+ {"rb_protect", (RUBY_PROC*)&dll_rb_protect},
+ {"rb_load", (RUBY_PROC*)&dll_rb_load},
{"rb_num2long", (RUBY_PROC*)&dll_rb_num2long},
{"rb_num2ulong", (RUBY_PROC*)&dll_rb_num2ulong},
{"rb_obj_alloc", (RUBY_PROC*)&dll_rb_obj_alloc},
@@ -831,7 +834,8 @@ void ex_rubyfile(exarg_T *eap)
if (ensure_ruby_initialized())
{
- rb_load_protect(rb_str_new2((char *) eap->arg), 0, &state);
+ rb_protect((VALUE (*)(VALUE))rb_load, rb_str_new2((char *)eap->arg),
+ &state);
if (state) error_print(state);
}
}