Mercurial > vim
comparison src/if_ruby.c @ 12716:351cf7c67bbe v8.0.1236
patch 8.0.1236: Mac features are confusing
commit https://github.com/vim/vim/commit/d057301b1f28736f094affa17b190244ad56e8d9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 28 21:11:06 2017 +0200
patch 8.0.1236: Mac features are confusing
Problem: Mac features are confusing.
Solution: Make feature names more consistent, add "osxdarwin". Rename
feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes #2178)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 28 Oct 2017 21:15:35 +0200 |
parents | 270aec277c81 |
children | f06a0a75d5b1 |
comparison
equal
deleted
inserted
replaced
12715:279ec0abb4ac | 12716:351cf7c67bbe |
---|---|
125 #undef off_t /* ruby defines off_t as _int64, Mingw uses long */ | 125 #undef off_t /* ruby defines off_t as _int64, Mingw uses long */ |
126 #undef EXTERN | 126 #undef EXTERN |
127 #undef _ | 127 #undef _ |
128 | 128 |
129 /* T_DATA defined both by Ruby and Mac header files, hack around it... */ | 129 /* T_DATA defined both by Ruby and Mac header files, hack around it... */ |
130 #if defined(MACOS_X_UNIX) || defined(macintosh) | 130 #if defined(MACOS_X) |
131 # define __OPENTRANSPORT__ | 131 # define __OPENTRANSPORT__ |
132 # define __OPENTRANSPORTPROTOCOL__ | 132 # define __OPENTRANSPORTPROTOCOL__ |
133 # define __OPENTRANSPORTPROVIDERS__ | 133 # define __OPENTRANSPORTPROVIDERS__ |
134 #endif | 134 #endif |
135 | 135 |
249 # endif | 249 # endif |
250 # define rb_num2uint dll_rb_num2uint | 250 # define rb_num2uint dll_rb_num2uint |
251 # endif | 251 # endif |
252 # define rb_lastline_get dll_rb_lastline_get | 252 # define rb_lastline_get dll_rb_lastline_get |
253 # define rb_lastline_set dll_rb_lastline_set | 253 # define rb_lastline_set dll_rb_lastline_set |
254 # define rb_load_protect dll_rb_load_protect | 254 # define rb_protect dll_rb_protect |
255 # define rb_load dll_rb_load | |
255 # ifndef RUBY19_OR_LATER | 256 # ifndef RUBY19_OR_LATER |
256 # define rb_num2long dll_rb_num2long | 257 # define rb_num2long dll_rb_num2long |
257 # endif | 258 # endif |
258 # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19 | 259 # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19 |
259 # define rb_num2ulong dll_rb_num2ulong | 260 # define rb_num2ulong dll_rb_num2ulong |
374 static long (*dll_rb_num2int) (VALUE); | 375 static long (*dll_rb_num2int) (VALUE); |
375 static unsigned long (*dll_rb_num2uint) (VALUE); | 376 static unsigned long (*dll_rb_num2uint) (VALUE); |
376 # endif | 377 # endif |
377 static VALUE (*dll_rb_lastline_get) (void); | 378 static VALUE (*dll_rb_lastline_get) (void); |
378 static void (*dll_rb_lastline_set) (VALUE); | 379 static void (*dll_rb_lastline_set) (VALUE); |
379 static void (*dll_rb_load_protect) (VALUE, int, int*); | 380 static void (*dll_rb_protect) (VALUE (*)(VALUE), int, int*); |
381 static void (*dll_rb_load) (VALUE, int); | |
380 static long (*dll_rb_num2long) (VALUE); | 382 static long (*dll_rb_num2long) (VALUE); |
381 static unsigned long (*dll_rb_num2ulong) (VALUE); | 383 static unsigned long (*dll_rb_num2ulong) (VALUE); |
382 static VALUE (*dll_rb_obj_alloc) (VALUE); | 384 static VALUE (*dll_rb_obj_alloc) (VALUE); |
383 static VALUE (*dll_rb_obj_as_string) (VALUE); | 385 static VALUE (*dll_rb_obj_as_string) (VALUE); |
384 static VALUE (*dll_rb_obj_id) (VALUE); | 386 static VALUE (*dll_rb_obj_id) (VALUE); |
566 {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int}, | 568 {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int}, |
567 {"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint}, | 569 {"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint}, |
568 # endif | 570 # endif |
569 {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get}, | 571 {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get}, |
570 {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set}, | 572 {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set}, |
571 {"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect}, | 573 {"rb_protect", (RUBY_PROC*)&dll_rb_protect}, |
574 {"rb_load", (RUBY_PROC*)&dll_rb_load}, | |
572 {"rb_num2long", (RUBY_PROC*)&dll_rb_num2long}, | 575 {"rb_num2long", (RUBY_PROC*)&dll_rb_num2long}, |
573 {"rb_num2ulong", (RUBY_PROC*)&dll_rb_num2ulong}, | 576 {"rb_num2ulong", (RUBY_PROC*)&dll_rb_num2ulong}, |
574 {"rb_obj_alloc", (RUBY_PROC*)&dll_rb_obj_alloc}, | 577 {"rb_obj_alloc", (RUBY_PROC*)&dll_rb_obj_alloc}, |
575 {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, | 578 {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, |
576 {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, | 579 {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, |
829 { | 832 { |
830 int state; | 833 int state; |
831 | 834 |
832 if (ensure_ruby_initialized()) | 835 if (ensure_ruby_initialized()) |
833 { | 836 { |
834 rb_load_protect(rb_str_new2((char *) eap->arg), 0, &state); | 837 rb_protect((VALUE (*)(VALUE))rb_load, rb_str_new2((char *)eap->arg), |
838 &state); | |
835 if (state) error_print(state); | 839 if (state) error_print(state); |
836 } | 840 } |
837 } | 841 } |
838 | 842 |
839 void ruby_buffer_free(buf_T *buf) | 843 void ruby_buffer_free(buf_T *buf) |