summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-22 15:01:00 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-22 15:01:00 +0100
commit8b430b4c1df74bde757a7e5ee0ee2854fdad6472 (patch)
treed28364a62c10406a0c7c12958270e026a64cdf66 /src/if_ruby.c
parentf9706e9df0e37d214fb08eda30ba29627e97a607 (diff)
downloadvim-git-8b430b4c1df74bde757a7e5ee0ee2854fdad6472.tar.gz
patch 8.2.0297: compiler warnings for the Ruby interfacev8.2.0297
Problem: Compiler warnings for the Ruby interface. Solution: Undefine a few macros, fix initialization. (Ozaki Kiichi, closes #5677)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index f4e1e1239..a4a59f6bd 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -209,6 +209,14 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
/*
* Wrapper defines
*/
+// Ruby 2.7 actually expands the following symbols as macro.
+# if RUBY_VERSION >= 27
+# undef rb_define_global_function
+# undef rb_define_method
+# undef rb_define_module_function
+# undef rb_define_singleton_method
+# endif
+
# define rb_assoc_new dll_rb_assoc_new
# define rb_cObject (*dll_rb_cObject)
# define rb_class_new_instance dll_rb_class_new_instance
@@ -1228,7 +1236,7 @@ static const rb_data_type_t buffer_type = {
"vim_buffer",
{0, 0, buffer_dsize,
# if RUBY_VERSION >= 27
- 0, 0
+ 0, {0}
# else
{0, 0}
# endif
@@ -1508,7 +1516,7 @@ static const rb_data_type_t window_type = {
"vim_window",
{0, 0, window_dsize,
# if RUBY_VERSION >= 27
- 0, 0
+ 0, {0}
# else
{0, 0}
# endif