[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[patch] Building the Ruby bindings on windows with SWIG > 1.3.24

From: Joe Swatosh <joe.swatosh_at_gmail.com>
Date: 2007-04-07 22:36:33 CEST

Hi,

Here is a completely revised patch (much simpler) to get the Ruby bindings to
build with later versions of SWIG. This time I didn't try to include
the changes for
Perl. This worked for me with 1.3.24 and 1.3.31.

--
Joe
[[[
Log:
Make Ruby bindings creatable with more current version of SWIG.
* subversion/bindings/swig/include/svn_global.swg
In the SWIGRUBY section clear all the long long typemaps, then create typemaps
for the 64 bit values that the Ruby subversion bindings use.
]]]
Index: subversion/bindings/swig/include/svn_global.swg
===================================================================
--- subversion/bindings/swig/include/svn_global.swg     (revision 24494)
+++ subversion/bindings/swig/include/svn_global.swg     (working copy)
@@ -146,6 +146,22 @@
#ifdef SWIGRUBY
+
+/* Remove all the long long typemaps, then create exactly the ones we need. */
+/* These typemaps use apr_int64_t so that they will work on Win32 and Unix. */
+/* The argout typemap prevents the generation of the SWIG_From_long_ss_long */
+/* function (experimentation shows it needs to specify long long instead of */
+/* apr_int64_t to do this). */
+
+%clear long long;
+
+%typemap (out) apr_time_t, apr_int64_t
+  " $result = LL2NUM((apr_int64_t)($1)); ";
+
+%typemap(argout) long long *OUTPUT {
+  %append_output(LL2NUM(*$1));
+}
+
/* Ruby has strict capitalization conventions -
    tell SWIG to not warn as it renames things to follow these. */
#pragma SWIG nowarn=801
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 7 22:36:48 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.