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

Re: svn commit: r35852 - in trunk: build/ac-macros subversion/bindings/swig subversion/bindings/swig/include subversion/bindings/swig/ruby/libsvn_swig_ruby

From: Greg Stein <gstein_at_gmail.com>
Date: Sat, 14 Feb 2009 01:50:35 +0100

Why all the includes for svn_md5.h ?? That header is basically
deprecated, so I'm curious what its inclusion is for.

Cheers,
-g

On Fri, Feb 13, 2009 at 19:03, Arfrever Frehtes Taifersar Arahesis
<Arfrever.FTA_at_gmail.com> wrote:
> Author: arfrever
> Date: Fri Feb 13 08:48:08 2009
> New Revision: 35852
>
> Log:
> Fix building Ruby bindings with Ruby 1.9.
>
> * build/ac-macros/swig.m4
> (SVN_FIND_SWIG): Use appropriate -I options.
>
> * subversion/bindings/swig/core.i: Use RSTRING_LEN() and include svn_md5_h.swg.
>
> * subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
> (): Include <version.h>.
> (rb_holder_pop, svn_swig_rb_set_pool, svn_swig_rb_to_apr_array_row_prop,
> svn_swig_rb_to_apr_array_prop, svn_swig_rb_array_to_apr_array_revision_range,
> name, read_handler_rbio): Use RARRAY_LEN(), RARRAY_PTR() and RSTRING_LEN().
> (callback_rescue): Use rb_errinfo() instead of ruby_errinfo when Ruby >=1.9 is used.
>
> * subversion/bindings/swig/include/svn_types.swg
> (_swig_rb_closed): Use RSTRING_LEN().
>
> * subversion/bindings/swig/include/svn_string.swg
> (%typemap(in) svn_stringbuf_t *, %typemap(in) svn_stringbuf_t *node_name,
> %typemap(in) const svn_string_t * (svn_string_t value)): Use RSTRING_LEN().
>
> * subversion/bindings/swig/svn_fs.i:
> * subversion/bindings/swig/svn_wc.i:
> * subversion/bindings/swig/svn_delta.i: Include "svn_md5.h".
>
> Modified:
> trunk/build/ac-macros/swig.m4
> trunk/subversion/bindings/swig/core.i
> trunk/subversion/bindings/swig/include/svn_string.swg
> trunk/subversion/bindings/swig/include/svn_types.swg
> trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
> trunk/subversion/bindings/swig/svn_delta.i
> trunk/subversion/bindings/swig/svn_fs.i
> trunk/subversion/bindings/swig/svn_wc.i
>
> Modified: trunk/build/ac-macros/swig.m4
> URL: http://svn.collab.net/viewvc/svn/trunk/build/ac-macros/swig.m4?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/build/ac-macros/swig.m4 Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/build/ac-macros/swig.m4 Fri Feb 13 08:48:08 2009 (r35852)
> @@ -168,8 +168,8 @@ AC_DEFUN(SVN_FIND_SWIG,
> if test "$RUBY" != "none"; then
> rbconfig="$RUBY -rrbconfig -e "
>
> - for var_name in archdir CC CFLAGS LDSHARED DLEXT LIBRUBYARG \
> - sitedir sitelibdir sitearchdir libdir
> + for var_name in arch archdir CC CFLAGS LDSHARED DLEXT LIBRUBYARG \
> + rubyhdrdir sitedir sitelibdir sitearchdir libdir
> do
> rbconfig_tmp=`$rbconfig "print Config::CONFIG@<:@'$var_name'@:>@"`
> eval "rbconfig_$var_name=\"$rbconfig_tmp\""
> @@ -178,7 +178,13 @@ AC_DEFUN(SVN_FIND_SWIG,
> AC_MSG_NOTICE([Configuring Ruby SWIG binding])
>
> AC_CACHE_CHECK([for Ruby include path], [svn_cv_ruby_includes],[
> - svn_cv_ruby_includes="-I. -I$rbconfig_archdir"
> + if test -d "$rbconfig_rubyhdrdir"; then
> + dnl Ruby >=1.9
> + svn_cv_ruby_includes="-I. -I$rbconfig_rubyhdrdir -I$rbconfig_rubyhdrdir/ruby -I$rbconfig_rubyhdrdir/ruby/backward -I$rbconfig_rubyhdrdir/$rbconfig_arch"
> + else
> + dnl Ruby 1.8
> + svn_cv_ruby_includes="-I. -I$rbconfig_archdir"
> + fi
> ])
> SWIG_RB_INCLUDES="\$(SWIG_INCLUDES) $svn_cv_ruby_includes"
>
>
> Modified: trunk/subversion/bindings/swig/core.i
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/core.i?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/core.i Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/core.i Fri Feb 13 08:48:08 2009 (r35852)
> @@ -1,6 +1,6 @@
> /*
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2007, 2009 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -414,7 +414,7 @@
> %typemap(in) (const char *data, apr_size_t *len) ($*2_type temp)
> {
> $1 = StringValuePtr($input);
> - temp = RSTRING($input)->len;
> + temp = RSTRING_LEN($input);
> $2 = ($2_ltype)&temp;
> }
> #endif
> @@ -752,8 +752,11 @@ svn_swig_pl_set_current_pool (apr_pool_t
> %include svn_mergeinfo_h.swg
> %include svn_io_h.swg
>
> -#ifdef SWIGPERL
> +#if defined(SWIGPERL) || defined(SWIGRUBY)
> %include svn_md5_h.swg
> +#endif
> +
> +#ifdef SWIGPERL
> %include svn_diff_h.swg
> %include svn_error_h.swg
>
>
> Modified: trunk/subversion/bindings/swig/include/svn_string.swg
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/include/svn_string.swg?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/include/svn_string.swg Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/include/svn_string.swg Fri Feb 13 08:48:08 2009 (r35852)
> @@ -1,6 +1,6 @@
> /*
> * ====================================================================
> - * Copyright (c) 2000-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2006, 2009 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -107,7 +107,7 @@ typedef struct svn_string_t svn_string_t
> $1 = NULL;
> } else {
> $1 = svn_stringbuf_ncreate(StringValuePtr($input),
> - RSTRING($input)->len,
> + RSTRING_LEN($input),
> _global_pool);
> }
> }
> @@ -123,7 +123,7 @@ typedef struct svn_string_t svn_string_t
> svn_swig_rb_get_pool(argc, argv, self, &rb_pool, &pool);
>
> $1 = svn_stringbuf_ncreate(StringValuePtr($input),
> - RSTRING($input)->len,
> + RSTRING_LEN($input),
> pool);
> }
> }
> @@ -195,7 +195,7 @@ typedef struct svn_string_t svn_string_t
> $1 = NULL;
> } else {
> value.data = StringValuePtr($input);
> - value.len = RSTRING($input)->len;
> + value.len = RSTRING_LEN($input);
> $1 = &value;
> }
> }
>
> Modified: trunk/subversion/bindings/swig/include/svn_types.swg
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/include/svn_types.swg?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/include/svn_types.swg Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/include/svn_types.swg Fri Feb 13 08:48:08 2009 (r35852)
> @@ -1,6 +1,6 @@
> /*
> * ====================================================================
> - * Copyright (c) 2000-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2006, 2009 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -469,7 +469,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
> rb_raise(rb_eArgError, "Expecting a string");
> }
> $1 = StringValuePtr($input);
> - $2 = RSTRING(StringValue($input))->len;
> + $2 = RSTRING_LEN(StringValue($input));
> }
> #endif
>
> @@ -1110,9 +1110,9 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
> {
> if (NIL_P($input)) {
> $1 = NULL;
> - } else if (RSTRING($input)->len != APR_MD5_DIGESTSIZE) {
> + } else if (RSTRING_LEN($input) != APR_MD5_DIGESTSIZE) {
> rb_raise(rb_eArgError, "digest size (%d) must be %d",
> - RSTRING($input)->len, APR_MD5_DIGESTSIZE);
> + RSTRING_LEN($input), APR_MD5_DIGESTSIZE);
> } else {
> $1 = ($1_ltype)StringValuePtr($input);
> }
>
> Modified: trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Fri Feb 13 08:48:08 2009 (r35852)
> @@ -5,6 +5,7 @@
> #include "swig_ruby_external_runtime.swg"
> #include "swigutil_rb.h"
> #include <st.h>
> +#include <version.h>
>
> #undef PACKAGE_BUGREPORT
> #undef PACKAGE_NAME
> @@ -620,7 +621,7 @@ rb_holder_pop(VALUE holder, VALUE obj)
>
> if (!NIL_P(objs)) {
> result = rb_ary_pop(objs);
> - if (RARRAY(objs)->len == 0) {
> + if (RARRAY_LEN(objs) == 0) {
> rb_hash_delete(holder, key);
> }
> }
> @@ -749,8 +750,8 @@ svn_swig_rb_set_pool(VALUE target, VALUE
> long i;
> svn_boolean_t set = FALSE;
>
> - for (i = 0; i < RARRAY(target)->len; i++) {
> - if (svn_swig_rb_set_pool(RARRAY(target)->ptr[i], pool))
> + for (i = 0; i < RARRAY_LEN(target); i++) {
> + if (svn_swig_rb_set_pool(RARRAY_PTR(target)[i], pool))
> set = TRUE;
> }
> return set;
> @@ -1017,7 +1018,7 @@ svn_swig_rb_to_apr_array_row_prop(VALUE
> int i, len;
> apr_array_header_t *result;
>
> - len = RARRAY(array_or_hash)->len;
> + len = RARRAY_LEN(array_or_hash);
> result = apr_array_make(pool, len, sizeof(svn_prop_t));
> result->nelts = len;
> for (i = 0; i < len; i++) {
> @@ -1071,7 +1072,7 @@ svn_swig_rb_to_apr_array_prop(VALUE arra
> int i, len;
> apr_array_header_t *result;
>
> - len = RARRAY(array_or_hash)->len;
> + len = RARRAY_LEN(array_or_hash);
> result = apr_array_make(pool, len, sizeof(svn_prop_t *));
> result->nelts = len;
> for (i = 0; i < len; i++) {
> @@ -1326,7 +1327,7 @@ svn_swig_rb_array_to_apr_array_revision_
> apr_array_header_t *apr_ary;
>
> Check_Type(array, T_ARRAY);
> - len = RARRAY(array)->len;
> + len = RARRAY_LEN(array);
> apr_ary = apr_array_make(pool, len, sizeof(svn_opt_revision_range_t *));
> apr_ary->nelts = len;
> for (i = 0; i < len; i++) {
> @@ -1335,7 +1336,7 @@ svn_swig_rb_array_to_apr_array_revision_
>
> value = rb_ary_entry(array, i);
> if (RTEST(rb_obj_is_kind_of(value, rb_cArray))) {
> - if (RARRAY(value)->len != 2)
> + if (RARRAY_LEN(value) != 2)
> rb_raise(rb_eArgError,
> "revision range should be [start, end]: %s",
> r2c_inspect(value));
> @@ -1361,7 +1362,7 @@ name(VALUE array, apr_pool_t *pool)
> apr_array_header_t *apr_ary; \
> \
> Check_Type(array, T_ARRAY); \
> - len = RARRAY(array)->len; \
> + len = RARRAY_LEN(array); \
> apr_ary = apr_array_make(pool, len, sizeof(type)); \
> apr_ary->nelts = len; \
> for (i = 0; i < len; i++) { \
> @@ -1590,7 +1591,13 @@ callback_rescue(VALUE baton)
> {
> callback_rescue_baton_t *rescue_baton = (callback_rescue_baton_t*)baton;
>
> - *(rescue_baton->err) = r2c_svn_err(ruby_errinfo, NULL, NULL);
> + *(rescue_baton->err) = r2c_svn_err(
> +#if ((RUBY_VERSION_MAJOR >= 2) || ((RUBY_VERSION_MAJOR == 1) && (RUBY_VERSION_MINOR >= 9)))
> + rb_errinfo(),
> +#else
> + ruby_errinfo,
> +#endif
> + NULL, NULL);
> svn_swig_rb_push_pool(rescue_baton->pool);
>
> return Qnil;
> @@ -3131,8 +3138,8 @@ read_handler_rbio(void *baton, char *buf
> if (NIL_P(result)) {
> *len = 0;
> } else {
> - memcpy(buffer, StringValuePtr(result), RSTRING(result)->len);
> - *len = RSTRING(result)->len;
> + memcpy(buffer, StringValuePtr(result), RSTRING_LEN(result));
> + *len = RSTRING_LEN(result);
> }
>
> return err;
>
> Modified: trunk/subversion/bindings/swig/svn_delta.i
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/svn_delta.i?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_delta.i Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/svn_delta.i Fri Feb 13 08:48:08 2009 (r35852)
> @@ -1,6 +1,6 @@
> /*
> * ====================================================================
> - * Copyright (c) 2000-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2006, 2009 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -150,6 +150,7 @@ void svn_delta_wrap_window_handler(svn_t
>
> %{
> #include <apr_md5.h>
> +#include "svn_md5.h"
> %}
>
> /* -----------------------------------------------------------------------
>
> Modified: trunk/subversion/bindings/swig/svn_fs.i
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/svn_fs.i?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_fs.i Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/svn_fs.i Fri Feb 13 08:48:08 2009 (r35852)
> @@ -1,6 +1,6 @@
> /*
> * ====================================================================
> - * Copyright (c) 2000-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2006, 2009 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -125,6 +125,7 @@ svn_fs_root_fs_wrapper(svn_fs_root_t *ro
>
> %{
> #include <apr_md5.h>
> +#include "svn_md5.h"
> %}
>
> %include svn_fs_h.swg
>
> Modified: trunk/subversion/bindings/swig/svn_wc.i
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/svn_wc.i?pathrev=35852&r1=35851&r2=35852
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_wc.i Fri Feb 13 08:28:37 2009 (r35851)
> +++ trunk/subversion/bindings/swig/svn_wc.i Fri Feb 13 08:48:08 2009 (r35852)
> @@ -1,6 +1,6 @@
> /*
> * ====================================================================
> - * Copyright (c) 2000-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2006, 2009 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -229,6 +229,7 @@
>
> %{
> #include <apr_md5.h>
> +#include "svn_md5.h"
> %}
>
> %include svn_wc_h.swg
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1152248
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1154350
Received on 2009-02-14 01:50:54 CET

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