Guest User

Untitled

a guest
Jul 18th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. diff -r bfade53bcafb src/if_ruby.c
  2. --- a/src/if_ruby.c Fri Dec 17 20:24:01 2010 +0100
  3. +++ b/src/if_ruby.c Fri Dec 24 18:44:07 2010 +0900
  4. @@ -90,6 +90,7 @@
  5. # include <ruby/encoding.h>
  6. #endif
  7.  
  8. +#undef off_t
  9. #undef EXTERN
  10. #undef _
  11.  
  12. @@ -229,10 +230,10 @@
  13. # define rb_enc_find_index dll_rb_enc_find_index
  14. # define rb_enc_find dll_rb_enc_find
  15. # define rb_enc_str_new dll_rb_enc_str_new
  16. -# define rb_intern2 dll_rb_intern2
  17. -# define rb_const_remove dll_rb_const_remove
  18. # define rb_sprintf dll_rb_sprintf
  19. +# define rb_require dll_rb_require
  20. # define ruby_init_stack dll_ruby_init_stack
  21. +# define ruby_process_options dll_ruby_process_options
  22. #endif
  23.  
  24. /*
  25. @@ -319,11 +320,10 @@
  26. static int (*dll_rb_enc_find_index) (const char*);
  27. static rb_encoding* (*dll_rb_enc_find) (const char*);
  28. static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
  29. -static ID (*dll_rb_intern2) (const char*, long);
  30. -static void (*dll_Init_prelude) (void);
  31. -static VALUE (*dll_rb_const_remove) (VALUE, ID);
  32. static VALUE (*dll_rb_sprintf) (const char*, ...);
  33. +static VALUE (*dll_rb_require) (const char*);
  34. static void (*ruby_init_stack)(VALUE*);
  35. +static void* (*ruby_process_options)(int, char**);
  36. #endif
  37.  
  38. #ifdef RUBY19_OR_LATER
  39. @@ -430,10 +430,10 @@
  40. {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index},
  41. {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find},
  42. {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
  43. - {"rb_intern2", (RUBY_PROC*)&dll_rb_intern2},
  44. - {"rb_const_remove", (RUBY_PROC*)&dll_rb_const_remove},
  45. {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
  46. + {"rb_require", (RUBY_PROC*)&dll_rb_require},
  47. {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
  48. + {"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options},
  49. #endif
  50. {"", NULL},
  51. };
  52. @@ -663,18 +663,16 @@
  53. ruby_init();
  54. }
  55. #ifdef RUBY19_OR_LATER
  56. + {
  57. + int dummy_argc = 2;
  58. + char *dummy_argv[] = {"vim-ruby", "-e0"};
  59. + ruby_process_options(dummy_argc, dummy_argv);
  60. + }
  61. ruby_script("vim-ruby");
  62. +#else
  63. + ruby_init_loadpath();
  64. #endif
  65. - ruby_init_loadpath();
  66. ruby_io_init();
  67. -#ifdef RUBY19_OR_LATER
  68. - rb_enc_find_index("encdb");
  69. -
  70. - /* This avoids the error "Encoding::ConverterNotFoundError: code
  71. - * converter not found (UTF-16LE to ASCII-8BIT)". */
  72. - rb_define_module("Gem");
  73. - rb_const_remove(rb_cObject, rb_intern2("TMP_RUBY_PREFIX", 15));
  74. -#endif
  75. ruby_vim_init();
  76. ruby_initialized = 1;
  77. #ifdef DYNAMIC_RUBY
Add Comment
Please, Sign In to add comment