Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory
subversion
subversion-1.14.4-swig-4.3.0-swig-rb.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File subversion-1.14.4-swig-4.3.0-swig-rb.patch of Package subversion
------------------------------------------------------------------------ r1921506 | jun66j5 | 2024-10-23 12:44:41 +0200 (Wed, 23 Oct 2024) | 27 lines Changed paths: M /subversion/trunk/subversion/bindings/swig/include/svn_containers.swg M /subversion/trunk/subversion/bindings/swig/include/svn_types.swg M /subversion/trunk/subversion/bindings/swig/ruby/svn/core.rb M /subversion/trunk/subversion/bindings/swig/svn_wc.i Make swig-rb compatible with SWIG 4.3.0. * subversion/bindings/swig/include/svn_containers.swg (%typemap(out) apr_hash_t *PROPHASH, %typemap(out) apr_hash_t *CHANGED_PATH_HASH, %typemap(out) apr_array_header_t *PROP_LIST, %typemap(out) apr_array_header_t *PROP_LIST_MAY_BE_NULL): Set the return value to `$result` rather than using `%append_output` in `%typemap(out)` for Ruby. * subversion/bindings/swig/include/svn_types.swg (%typemap(out) svn_error_t *): Initialize `$result` with an empty array for the workaround to `%append_output` incorrectly handling for nil and a list in Ruby. (%typemap(ret) svn_error_t *): Use first entry for `$result` when the size of the `$result` list is 1. * subversion/bindings/swig/ruby/svn/core.rb (Svn::Core::RangeList.diff): Revised because multiple values are correctly retrieved from SWIG methods now. * subversion/bindings/swig/svn_wc.i (%typemap(ret) svn_error_t *err): Added because `%typemap(out) svn_error_t *err` is defined. ------------------------------------------------------------------------ Index: trunk/subversion/bindings/swig/include/svn_containers.swg =================================================================== --- trunk/subversion/bindings/swig/include/svn_containers.swg (revision 1921505) +++ trunk/subversion/bindings/swig/include/svn_containers.swg (revision 1921506) @@ -310,7 +310,7 @@ %typemap(out) apr_hash_t *PROPHASH { - %append_output(svn_swig_rb_apr_hash_to_hash_svn_string($1)); + $result = svn_swig_rb_apr_hash_to_hash_svn_string($1); } #endif @@ -326,10 +326,8 @@ #ifdef SWIGRUBY %typemap(out) apr_hash_t *CHANGED_PATH_HASH { - VALUE rb_changed_path_hash; - rb_changed_path_hash = + $result = svn_swig_rb_apr_hash_to_hash_swig_type($1, "svn_log_changed_path_t *"); - %append_output(rb_changed_path_hash); } %apply apr_hash_t *CHANGED_PATH_HASH { @@ -760,7 +758,7 @@ %typemap(out) apr_array_header_t *PROP_LIST { - %append_output(svn_swig_rb_prop_apr_array_to_hash_prop($1)); + $result = svn_swig_rb_prop_apr_array_to_hash_prop($1); } %typemap(in) apr_array_header_t *PROP_LIST_MAY_BE_NULL @@ -778,7 +776,7 @@ %typemap(out) apr_array_header_t *PROP_LIST_MAY_BE_NULL { - %append_output($1 ? svn_swig_rb_prop_apr_array_to_hash_prop($1) : Qnil); + $result = $1 ? svn_swig_rb_prop_apr_array_to_hash_prop($1) : Qnil; } %apply apr_array_header_t *PROP_LIST { Index: trunk/subversion/bindings/swig/include/svn_types.swg =================================================================== --- trunk/subversion/bindings/swig/include/svn_types.swg (revision 1921505) +++ trunk/subversion/bindings/swig/include/svn_types.swg (revision 1921506) @@ -532,7 +532,7 @@ #endif #ifdef SWIGRUBY -%typemap(out) svn_error_t * +%typemap(out) svn_error_t * (VALUE *svn_presult = NULL) { if ($1) { svn_swig_rb_destroy_pool(_global_svn_swig_rb_pool); @@ -539,8 +539,23 @@ svn_swig_rb_pop_pool(_global_svn_swig_rb_pool); svn_swig_rb_handle_svn_error($1); } - $result = Qnil; + $result = rb_ary_new(); + svn_presult = &$result; } + +%typemap(ret) svn_error_t * +{ + if (TYPE(*svn_presult) == T_ARRAY) { + switch (rb_array_len(*svn_presult)) { + case 0: + *svn_presult = Qnil; + break; + case 1: + *svn_presult = rb_ary_entry(*svn_presult, 0); + break; + } + } +} #endif /* ----------------------------------------------------------------------- Index: trunk/subversion/bindings/swig/ruby/svn/core.rb =================================================================== --- trunk/subversion/bindings/swig/ruby/svn/core.rb (revision 1921505) +++ trunk/subversion/bindings/swig/ruby/svn/core.rb (revision 1921506) @@ -812,7 +812,7 @@ def diff(to, consider_inheritance=false) result = Core.rangelist_diff(self, to, consider_inheritance) deleted = result.pop - added = result + added = result.pop [added, deleted].collect do |result| self.class.new(*result) end Index: trunk/subversion/bindings/swig/svn_wc.i =================================================================== --- trunk/subversion/bindings/swig/svn_wc.i (revision 1921505) +++ trunk/subversion/bindings/swig/svn_wc.i (revision 1921506) @@ -242,6 +242,8 @@ { $result = $1 ? svn_swig_rb_svn_error_to_rb_error($1) : Qnil; } + +%typemap(ret) svn_error_t *err ""; #endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor