Karsten Hopp e05ad3
To: vim_dev@googlegroups.com
Karsten Hopp e05ad3
Subject: Patch 7.3.043
Karsten Hopp e05ad3
Fcc: outbox
Karsten Hopp e05ad3
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp e05ad3
Mime-Version: 1.0
Karsten Hopp e05ad3
Content-Type: text/plain; charset=UTF-8
Karsten Hopp e05ad3
Content-Transfer-Encoding: 8bit
Karsten Hopp e05ad3
------------
Karsten Hopp e05ad3
Karsten Hopp e05ad3
Patch 7.3.043
Karsten Hopp e05ad3
Problem:    Can't load Ruby dynamically on Unix.
Karsten Hopp e05ad3
Solution:   Adjust the configure script. (James Vega)
Karsten Hopp e05ad3
Files:	    src/Makefile, src/config.h.in, src/configure.in,
Karsten Hopp e05ad3
	    src/auto/configure, src/if_ruby.c
Karsten Hopp e05ad3
Karsten Hopp e05ad3
Karsten Hopp e05ad3
*** ../vim-7.3.042/src/Makefile	2010-08-16 21:59:00.000000000 +0200
Karsten Hopp e05ad3
--- src/Makefile	2010-10-27 16:46:41.000000000 +0200
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 414,425 ****
Karsten Hopp e05ad3
--- 414,429 ----
Karsten Hopp e05ad3
  # However, this may still cause problems, such as "import termios" failing.
Karsten Hopp e05ad3
  # Build two separate versions of Vim in that case.
Karsten Hopp e05ad3
  #CONF_OPT_PYTHON = --enable-pythoninterp
Karsten Hopp e05ad3
+ #CONF_OPT_PYTHON = --enable-pythoninterp=dynamic
Karsten Hopp e05ad3
  #CONF_OPT_PYTHON3 = --enable-python3interp
Karsten Hopp e05ad3
+ #CONF_OPT_PYTHON3 = --enable-python3interp=dynamic
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  # RUBY
Karsten Hopp e05ad3
  # Uncomment this when you want to include the Ruby interface.
Karsten Hopp e05ad3
+ # First one for static linking, second one for loading when used.
Karsten Hopp e05ad3
  # Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
Karsten Hopp e05ad3
  #CONF_OPT_RUBY = --enable-rubyinterp
Karsten Hopp e05ad3
+ #CONF_OPT_RUBY = --enable-rubyinterp=dynamic
Karsten Hopp e05ad3
  #CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  # TCL
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 1047,1054 ****
Karsten Hopp e05ad3
  INSTALL_DATA	= cp
Karsten Hopp e05ad3
  INSTALL_DATA_R	= cp -r
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! ### Program to run on installed binary
Karsten Hopp e05ad3
  #STRIP = strip
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  ### Permissions for binaries  {{{1
Karsten Hopp e05ad3
  BINMOD = 755
Karsten Hopp e05ad3
--- 1051,1059 ----
Karsten Hopp e05ad3
  INSTALL_DATA	= cp
Karsten Hopp e05ad3
  INSTALL_DATA_R	= cp -r
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! ### Program to run on installed binary.  Use the second one to disable strip.
Karsten Hopp e05ad3
  #STRIP = strip
Karsten Hopp e05ad3
+ #STRIP = /bin/true
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  ### Permissions for binaries  {{{1
Karsten Hopp e05ad3
  BINMOD = 755
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 1321,1327 ****
Karsten Hopp e05ad3
  .SUFFIXES: .c .o .pro
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
Karsten Hopp e05ad3
! POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(RUBY_CFLAGS) $(EXTRA_DEFS)
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS)
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
--- 1326,1332 ----
Karsten Hopp e05ad3
  .SUFFIXES: .c .o .pro
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
Karsten Hopp e05ad3
! POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS)
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS)
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 1329,1335 ****
Karsten Hopp e05ad3
  # with "-E".
Karsten Hopp e05ad3
  OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
--- 1334,1340 ----
Karsten Hopp e05ad3
  # with "-E".
Karsten Hopp e05ad3
  OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 2532,2538 ****
Karsten Hopp e05ad3
  	$(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  objects/if_ruby.o: if_ruby.c
Karsten Hopp e05ad3
! 	$(CCC) -o $@ if_ruby.c
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  objects/if_sniff.o: if_sniff.c
Karsten Hopp e05ad3
  	$(CCC) -o $@ if_sniff.c
Karsten Hopp e05ad3
--- 2537,2543 ----
Karsten Hopp e05ad3
  	$(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  objects/if_ruby.o: if_ruby.c
Karsten Hopp e05ad3
! 	$(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  objects/if_sniff.o: if_sniff.c
Karsten Hopp e05ad3
  	$(CCC) -o $@ if_sniff.c
Karsten Hopp e05ad3
*** ../vim-7.3.042/src/config.h.in	2010-08-15 21:57:32.000000000 +0200
Karsten Hopp e05ad3
--- src/config.h.in	2010-10-27 16:21:24.000000000 +0200
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 349,354 ****
Karsten Hopp e05ad3
--- 349,357 ----
Karsten Hopp e05ad3
  /* Define if you want to include the Ruby interpreter. */
Karsten Hopp e05ad3
  #undef FEAT_RUBY
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
+ /* Define for linking via dlopen() or LoadLibrary() */
Karsten Hopp e05ad3
+ #undef DYNAMIC_RUBY
Karsten Hopp e05ad3
+ 
Karsten Hopp e05ad3
  /* Define if you want to include the Tcl interpreter. */
Karsten Hopp e05ad3
  #undef FEAT_TCL
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
*** ../vim-7.3.042/src/configure.in	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp e05ad3
--- src/configure.in	2010-10-27 16:20:53.000000000 +0200
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 1299,1308 ****
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  AC_MSG_CHECKING(--enable-rubyinterp argument)
Karsten Hopp e05ad3
  AC_ARG_ENABLE(rubyinterp,
Karsten Hopp e05ad3
! 	[  --enable-rubyinterp     Include Ruby interpreter.], ,
Karsten Hopp e05ad3
  	[enable_rubyinterp="no"])
Karsten Hopp e05ad3
  AC_MSG_RESULT($enable_rubyinterp)
Karsten Hopp e05ad3
! if test "$enable_rubyinterp" = "yes"; then
Karsten Hopp e05ad3
    AC_MSG_CHECKING(--with-ruby-command argument)
Karsten Hopp e05ad3
    AC_ARG_WITH(ruby-command, [  --with-ruby-command=RUBY  name of the Ruby command (default: ruby)],
Karsten Hopp e05ad3
  	RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
Karsten Hopp e05ad3
--- 1299,1308 ----
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  AC_MSG_CHECKING(--enable-rubyinterp argument)
Karsten Hopp e05ad3
  AC_ARG_ENABLE(rubyinterp,
Karsten Hopp e05ad3
! 	[  --enable-rubyinterp[=OPTS]     Include Ruby interpreter.  [default=no] [OPTS=no/yes/dynamic]], ,
Karsten Hopp e05ad3
  	[enable_rubyinterp="no"])
Karsten Hopp e05ad3
  AC_MSG_RESULT($enable_rubyinterp)
Karsten Hopp e05ad3
! if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
Karsten Hopp e05ad3
    AC_MSG_CHECKING(--with-ruby-command argument)
Karsten Hopp e05ad3
    AC_ARG_WITH(ruby-command, [  --with-ruby-command=RUBY  name of the Ruby command (default: ruby)],
Karsten Hopp e05ad3
  	RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 1360,1365 ****
Karsten Hopp e05ad3
--- 1360,1371 ----
Karsten Hopp e05ad3
  	RUBY_OBJ="objects/if_ruby.o"
Karsten Hopp e05ad3
  	RUBY_PRO="if_ruby.pro"
Karsten Hopp e05ad3
  	AC_DEFINE(FEAT_RUBY)
Karsten Hopp e05ad3
+ 	if test "$enable_rubyinterp" = "dynamic"; then
Karsten Hopp e05ad3
+ 	  libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG[["RUBY_SO_NAME"]], Config::CONFIG[["DLEXT"]]'`
Karsten Hopp e05ad3
+ 	  AC_DEFINE(DYNAMIC_RUBY)
Karsten Hopp e05ad3
+ 	  RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
Karsten Hopp e05ad3
+ 	  RUBY_LIBS=
Karsten Hopp e05ad3
+ 	fi
Karsten Hopp e05ad3
        else
Karsten Hopp e05ad3
  	AC_MSG_RESULT(not found; disabling Ruby)
Karsten Hopp e05ad3
        fi
Karsten Hopp e05ad3
*** ../vim-7.3.042/src/auto/configure	2010-08-15 21:57:27.000000000 +0200
Karsten Hopp e05ad3
--- src/auto/configure	2010-10-27 16:28:10.000000000 +0200
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 1427,1433 ****
Karsten Hopp e05ad3
    --enable-pythoninterp=OPTS   Include Python interpreter. default=no OPTS=no/yes/dynamic
Karsten Hopp e05ad3
    --enable-python3interp=OPTS   Include Python3 interpreter. default=no OPTS=no/yes/dynamic
Karsten Hopp e05ad3
    --enable-tclinterp      Include Tcl interpreter.
Karsten Hopp e05ad3
!   --enable-rubyinterp     Include Ruby interpreter.
Karsten Hopp e05ad3
    --enable-cscope         Include cscope interface.
Karsten Hopp e05ad3
    --enable-workshop       Include Sun Visual Workshop support.
Karsten Hopp e05ad3
    --disable-netbeans      Disable NetBeans integration support.
Karsten Hopp e05ad3
--- 1427,1433 ----
Karsten Hopp e05ad3
    --enable-pythoninterp=OPTS   Include Python interpreter. default=no OPTS=no/yes/dynamic
Karsten Hopp e05ad3
    --enable-python3interp=OPTS   Include Python3 interpreter. default=no OPTS=no/yes/dynamic
Karsten Hopp e05ad3
    --enable-tclinterp      Include Tcl interpreter.
Karsten Hopp e05ad3
!   --enable-rubyinterp=OPTS     Include Ruby interpreter.  default=no OPTS=no/yes/dynamic
Karsten Hopp e05ad3
    --enable-cscope         Include cscope interface.
Karsten Hopp e05ad3
    --enable-workshop       Include Sun Visual Workshop support.
Karsten Hopp e05ad3
    --disable-netbeans      Disable NetBeans integration support.
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 6103,6109 ****
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5
Karsten Hopp e05ad3
  $as_echo "$enable_rubyinterp" >&6; }
Karsten Hopp e05ad3
! if test "$enable_rubyinterp" = "yes"; then
Karsten Hopp e05ad3
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5
Karsten Hopp e05ad3
  $as_echo_n "checking --with-ruby-command argument... " >&6; }
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
--- 6103,6109 ----
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5
Karsten Hopp e05ad3
  $as_echo "$enable_rubyinterp" >&6; }
Karsten Hopp e05ad3
! if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
Karsten Hopp e05ad3
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5
Karsten Hopp e05ad3
  $as_echo_n "checking --with-ruby-command argument... " >&6; }
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 6209,6214 ****
Karsten Hopp e05ad3
--- 6209,6221 ----
Karsten Hopp e05ad3
  	RUBY_PRO="if_ruby.pro"
Karsten Hopp e05ad3
  	$as_echo "#define FEAT_RUBY 1" >>confdefs.h
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
+ 	if test "$enable_rubyinterp" = "dynamic"; then
Karsten Hopp e05ad3
+ 	  libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG["RUBY_SO_NAME"], Config::CONFIG["DLEXT"]'`
Karsten Hopp e05ad3
+ 	  $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h
Karsten Hopp e05ad3
+ 
Karsten Hopp e05ad3
+ 	  RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
Karsten Hopp e05ad3
+ 	  RUBY_LIBS=
Karsten Hopp e05ad3
+ 	fi
Karsten Hopp e05ad3
        else
Karsten Hopp e05ad3
  	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found; disabling Ruby" >&5
Karsten Hopp e05ad3
  $as_echo "not found; disabling Ruby" >&6; }
Karsten Hopp e05ad3
*** ../vim-7.3.042/src/if_ruby.c	2010-10-23 14:02:48.000000000 +0200
Karsten Hopp e05ad3
--- src/if_ruby.c	2010-10-27 16:40:27.000000000 +0200
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 14,19 ****
Karsten Hopp e05ad3
--- 14,21 ----
Karsten Hopp e05ad3
  #include <stdio.h>
Karsten Hopp e05ad3
  #include <string.h>
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
+ #include "auto/config.h"
Karsten Hopp e05ad3
+ 
Karsten Hopp e05ad3
  #ifdef _WIN32
Karsten Hopp e05ad3
  # if !defined(DYNAMIC_RUBY_VER) || (DYNAMIC_RUBY_VER < 18)
Karsten Hopp e05ad3
  #   define NT
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 48,60 ****
Karsten Hopp e05ad3
  #  define RUBY_EXPORT
Karsten Hopp e05ad3
  # endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! #if !(defined(WIN32) || defined(_WIN64))
Karsten Hopp e05ad3
  # include <dlfcn.h>
Karsten Hopp e05ad3
! # define HANDLE void*
Karsten Hopp e05ad3
  # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
Karsten Hopp e05ad3
  # define symbol_from_dll dlsym
Karsten Hopp e05ad3
  # define close_dll dlclose
Karsten Hopp e05ad3
  #else
Karsten Hopp e05ad3
  # define load_dll vimLoadLib
Karsten Hopp e05ad3
  # define symbol_from_dll GetProcAddress
Karsten Hopp e05ad3
  # define close_dll FreeLibrary
Karsten Hopp e05ad3
--- 50,64 ----
Karsten Hopp e05ad3
  #  define RUBY_EXPORT
Karsten Hopp e05ad3
  # endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! #ifndef WIN3264
Karsten Hopp e05ad3
  # include <dlfcn.h>
Karsten Hopp e05ad3
! # define HINSTANCE void*
Karsten Hopp e05ad3
! # define RUBY_PROC void*
Karsten Hopp e05ad3
  # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
Karsten Hopp e05ad3
  # define symbol_from_dll dlsym
Karsten Hopp e05ad3
  # define close_dll dlclose
Karsten Hopp e05ad3
  #else
Karsten Hopp e05ad3
+ # define RUBY_PROC FARPROC
Karsten Hopp e05ad3
  # define load_dll vimLoadLib
Karsten Hopp e05ad3
  # define symbol_from_dll GetProcAddress
Karsten Hopp e05ad3
  # define close_dll FreeLibrary
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 174,180 ****
Karsten Hopp e05ad3
--- 178,186 ----
Karsten Hopp e05ad3
  #define rb_lastline_get			dll_rb_lastline_get
Karsten Hopp e05ad3
  #define rb_lastline_set			dll_rb_lastline_set
Karsten Hopp e05ad3
  #define rb_load_protect			dll_rb_load_protect
Karsten Hopp e05ad3
+ #ifndef RUBY19_OR_LATER
Karsten Hopp e05ad3
  #define rb_num2long			dll_rb_num2long
Karsten Hopp e05ad3
+ #endif
Karsten Hopp e05ad3
  #define rb_num2ulong			dll_rb_num2ulong
Karsten Hopp e05ad3
  #define rb_obj_alloc			dll_rb_obj_alloc
Karsten Hopp e05ad3
  #define rb_obj_as_string		dll_rb_obj_as_string
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 186,191 ****
Karsten Hopp e05ad3
--- 192,200 ----
Karsten Hopp e05ad3
  #ifdef rb_str_new2
Karsten Hopp e05ad3
  /* Ruby may #define rb_str_new2 to use rb_str_new_cstr. */
Karsten Hopp e05ad3
  # define need_rb_str_new_cstr 1
Karsten Hopp e05ad3
+ /* Ruby's headers #define rb_str_new_cstr to make use of GCC's
Karsten Hopp e05ad3
+  * __builtin_constant_p extension. */
Karsten Hopp e05ad3
+ # undef rb_str_new_cstr
Karsten Hopp e05ad3
  # define rb_str_new_cstr		dll_rb_str_new_cstr
Karsten Hopp e05ad3
  #else
Karsten Hopp e05ad3
  # define rb_str_new2			dll_rb_str_new2
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 206,214 ****
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  #define ruby_init			dll_ruby_init
Karsten Hopp e05ad3
  #define ruby_init_loadpath		dll_ruby_init_loadpath
Karsten Hopp e05ad3
! #define NtInitialize			dll_NtInitialize
Karsten Hopp e05ad3
! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
! # define rb_w32_snprintf		dll_rb_w32_snprintf
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  #ifdef RUBY19_OR_LATER
Karsten Hopp e05ad3
--- 215,225 ----
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  #define ruby_init			dll_ruby_init
Karsten Hopp e05ad3
  #define ruby_init_loadpath		dll_ruby_init_loadpath
Karsten Hopp e05ad3
! #ifdef WIN3264
Karsten Hopp e05ad3
! # define NtInitialize			dll_NtInitialize
Karsten Hopp e05ad3
! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
! #  define rb_w32_snprintf		dll_rb_w32_snprintf
Karsten Hopp e05ad3
! # endif
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  #ifdef RUBY19_OR_LATER
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 283,289 ****
Karsten Hopp e05ad3
--- 294,305 ----
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  static void (*dll_ruby_init) (void);
Karsten Hopp e05ad3
  static void (*dll_ruby_init_loadpath) (void);
Karsten Hopp e05ad3
+ #ifdef WIN3264
Karsten Hopp e05ad3
  static void (*dll_NtInitialize) (int*, char***);
Karsten Hopp e05ad3
+ # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
+ static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
Karsten Hopp e05ad3
+ # endif
Karsten Hopp e05ad3
+ #endif
Karsten Hopp e05ad3
  #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
  static char * (*dll_rb_string_value_ptr) (volatile VALUE*);
Karsten Hopp e05ad3
  static VALUE (*dll_rb_float_new) (double);
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 293,301 ****
Karsten Hopp e05ad3
  #ifdef RUBY19_OR_LATER
Karsten Hopp e05ad3
  static VALUE (*dll_rb_int2big)(SIGNED_VALUE);
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
- #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
- static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
Karsten Hopp e05ad3
- #endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  #ifdef RUBY19_OR_LATER
Karsten Hopp e05ad3
  static void (*dll_ruby_script) (const char*);
Karsten Hopp e05ad3
--- 309,314 ----
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 317,328 ****
Karsten Hopp e05ad3
  }
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  /*
Karsten Hopp e05ad3
   * Table of name to function pointer of ruby.
Karsten Hopp e05ad3
   */
Karsten Hopp e05ad3
- #define RUBY_PROC FARPROC
Karsten Hopp e05ad3
  static struct
Karsten Hopp e05ad3
  {
Karsten Hopp e05ad3
      char *name;
Karsten Hopp e05ad3
--- 330,340 ----
Karsten Hopp e05ad3
  }
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
! static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  /*
Karsten Hopp e05ad3
   * Table of name to function pointer of ruby.
Karsten Hopp e05ad3
   */
Karsten Hopp e05ad3
  static struct
Karsten Hopp e05ad3
  {
Karsten Hopp e05ad3
      char *name;
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 387,401 ****
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
      {"ruby_init", (RUBY_PROC*)&dll_ruby_init},
Karsten Hopp e05ad3
      {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
Karsten Hopp e05ad3
      {
Karsten Hopp e05ad3
! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
Karsten Hopp e05ad3
      "NtInitialize",
Karsten Hopp e05ad3
! #else
Karsten Hopp e05ad3
      "ruby_sysinit",
Karsten Hopp e05ad3
! #endif
Karsten Hopp e05ad3
  			(RUBY_PROC*)&dll_NtInitialize},
Karsten Hopp e05ad3
! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
      {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
      {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr},
Karsten Hopp e05ad3
--- 399,415 ----
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
      {"ruby_init", (RUBY_PROC*)&dll_ruby_init},
Karsten Hopp e05ad3
      {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
Karsten Hopp e05ad3
+ #ifdef WIN3264
Karsten Hopp e05ad3
      {
Karsten Hopp e05ad3
! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
Karsten Hopp e05ad3
      "NtInitialize",
Karsten Hopp e05ad3
! # else
Karsten Hopp e05ad3
      "ruby_sysinit",
Karsten Hopp e05ad3
! # endif
Karsten Hopp e05ad3
  			(RUBY_PROC*)&dll_NtInitialize},
Karsten Hopp e05ad3
! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
      {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
Karsten Hopp e05ad3
+ # endif
Karsten Hopp e05ad3
  #endif
Karsten Hopp e05ad3
  #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
Karsten Hopp e05ad3
      {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr},
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 424,430 ****
Karsten Hopp e05ad3
      if (hinstRuby)
Karsten Hopp e05ad3
      {
Karsten Hopp e05ad3
  	close_dll(hinstRuby);
Karsten Hopp e05ad3
! 	hinstRuby = 0;
Karsten Hopp e05ad3
      }
Karsten Hopp e05ad3
  }
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
--- 438,444 ----
Karsten Hopp e05ad3
      if (hinstRuby)
Karsten Hopp e05ad3
      {
Karsten Hopp e05ad3
  	close_dll(hinstRuby);
Karsten Hopp e05ad3
! 	hinstRuby = NULL;
Karsten Hopp e05ad3
      }
Karsten Hopp e05ad3
  }
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 454,460 ****
Karsten Hopp e05ad3
  			ruby_funcname_table[i].name)))
Karsten Hopp e05ad3
  	{
Karsten Hopp e05ad3
  	    close_dll(hinstRuby);
Karsten Hopp e05ad3
! 	    hinstRuby = 0;
Karsten Hopp e05ad3
  	    if (verbose)
Karsten Hopp e05ad3
  		EMSG2(_(e_loadfunc), ruby_funcname_table[i].name);
Karsten Hopp e05ad3
  	    return FAIL;
Karsten Hopp e05ad3
--- 468,474 ----
Karsten Hopp e05ad3
  			ruby_funcname_table[i].name)))
Karsten Hopp e05ad3
  	{
Karsten Hopp e05ad3
  	    close_dll(hinstRuby);
Karsten Hopp e05ad3
! 	    hinstRuby = NULL;
Karsten Hopp e05ad3
  	    if (verbose)
Karsten Hopp e05ad3
  		EMSG2(_(e_loadfunc), ruby_funcname_table[i].name);
Karsten Hopp e05ad3
  	    return FAIL;
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 936,944 ****
Karsten Hopp e05ad3
  	return line ? vim_str2rb_enc_str(line) : Qnil;
Karsten Hopp e05ad3
      }
Karsten Hopp e05ad3
      rb_raise(rb_eIndexError, "line number %ld out of range", (long)n);
Karsten Hopp e05ad3
- #ifndef __GNUC__
Karsten Hopp e05ad3
      return Qnil; /* For stop warning */
Karsten Hopp e05ad3
- #endif
Karsten Hopp e05ad3
  }
Karsten Hopp e05ad3
  
Karsten Hopp e05ad3
  static VALUE buffer_aref(VALUE self, VALUE num)
Karsten Hopp e05ad3
--- 950,956 ----
Karsten Hopp e05ad3
*** ../vim-7.3.042/src/version.c	2010-10-27 16:17:56.000000000 +0200
Karsten Hopp e05ad3
--- src/version.c	2010-10-27 16:45:28.000000000 +0200
Karsten Hopp e05ad3
***************
Karsten Hopp e05ad3
*** 716,717 ****
Karsten Hopp e05ad3
--- 716,719 ----
Karsten Hopp e05ad3
  {   /* Add new patch number below this line */
Karsten Hopp e05ad3
+ /**/
Karsten Hopp e05ad3
+     43,
Karsten Hopp e05ad3
  /**/
Karsten Hopp e05ad3
Karsten Hopp e05ad3
-- 
Karsten Hopp e05ad3
ARTHUR:        A scratch?  Your arm's off!
Karsten Hopp e05ad3
BLACK KNIGHT:  No, it isn't.
Karsten Hopp e05ad3
ARTHUR:        Well, what's that then?
Karsten Hopp e05ad3
BLACK KNIGHT:  I've had worse.
Karsten Hopp e05ad3
                                  The Quest for the Holy Grail (Monty Python)
Karsten Hopp e05ad3
Karsten Hopp e05ad3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp e05ad3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp e05ad3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp e05ad3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///