Author: svn-role
Date: Sat Apr 5 04:00:20 2025
New Revision: 1924796
URL: http://svn.apache.org/viewvc?rev=1924796&view=rev
Log:
Merge r1924773 from trunk:
* r1924773
swig-rb: Support ruby x64-mswin64 and building with GCC 15.
Justification:
Allow swig-rb with x64-mswin64 and gcc 15
Votes:
+1: jun66j5, jamessan
Modified:
subversion/branches/1.14.x/ (props changed)
subversion/branches/1.14.x/STATUS
subversion/branches/1.14.x/build/generator/gen_win_dependencies.py
subversion/branches/1.14.x/subversion/bindings/swig/include/svn_types.swg
subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h
subversion/branches/1.14.x/subversion/bindings/swig/ruby/svn/util.rb
subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_fs.rb
subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_repos.rb
subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/windows_util.rb
subversion/branches/1.14.x/subversion/bindings/swig/svn_delta.i
subversion/branches/1.14.x/subversion/bindings/swig/svn_wc.i
subversion/branches/1.14.x/win-tests.py
Propchange: subversion/branches/1.14.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1924773
Modified: subversion/branches/1.14.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/STATUS?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/STATUS (original)
+++ subversion/branches/1.14.x/STATUS Sat Apr 5 04:00:20 2025
@@ -35,10 +35,3 @@ Veto-blocked changes:
Approved changes:
=================
-
-* r1924773
- swig-rb: Support ruby x64-mswin64 and building with GCC 15.
- Justification:
- Allow swig-rb with x64-mswin64 and gcc 15
- Votes:
- +1: jun66j5, jamessan
Modified: subversion/branches/1.14.x/build/generator/gen_win_dependencies.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/build/generator/gen_win_dependencies.py?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/build/generator/gen_win_dependencies.py (original)
+++ subversion/branches/1.14.x/build/generator/gen_win_dependencies.py Sat Apr 5 04:00:20 2025
@@ -1014,7 +1014,7 @@ class GenDependenciesBase(gen_base.Gener
else:
defines = []
- ver = ruby_version.split('.')
+ ver = ruby_version.split('+')[0].split('.')
ver = tuple(map(int, ver))
if ver >= (1, 8, 0):
defines.extend(["HAVE_RB_ERRINFO"])
Modified: subversion/branches/1.14.x/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/include/svn_types.swg?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/include/svn_types.swg Sat Apr 5 04:00:20 2025
@@ -394,7 +394,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
if (NIL_P($input)) {
} else if (TYPE($input) == T_FIXNUM) {
- $1 = (char *)NUM2INT($input);
+ $1 = (char *)NUM2SWIG($input);
if (!($1 == APR_LOCALE_CHARSET || $1 == APR_DEFAULT_CHARSET)) {
$1 = NULL;
}
Modified: subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Sat Apr 5 04:00:20 2025
@@ -696,6 +696,12 @@ rb_set_pool(VALUE self, VALUE pool)
}
static VALUE
+rb_set_pool_callback(RB_BLOCK_CALL_FUNC_ARGLIST(self, pool))
+{
+ return rb_set_pool(self, pool);
+}
+
+static VALUE
rb_pool_new(VALUE parent)
{
return rb_funcall(rb_svn_core_pool(), id_new, 1, parent);
@@ -760,9 +766,10 @@ struct rb_set_pool_for_hash_arg {
};
static int
-rb_set_pool_for_hash_callback(VALUE key, VALUE value,
- struct rb_set_pool_for_hash_arg *arg)
+rb_set_pool_for_hash_callback(VALUE key, VALUE value, VALUE hash_arg)
{
+ struct rb_set_pool_for_hash_arg *arg;
+ arg = (struct rb_set_pool_for_hash_arg *) hash_arg;
if (svn_swig_rb_set_pool(value, arg->pool))
arg->set = TRUE;
return ST_CONTINUE;
@@ -788,7 +795,7 @@ svn_swig_rb_set_pool(VALUE target, VALUE
struct rb_set_pool_for_hash_arg arg;
arg.set = FALSE;
arg.pool = pool;
- rb_hash_foreach(target, (int(*)(ANYARGS))rb_set_pool_for_hash_callback, (VALUE)&arg);
+ rb_hash_foreach(target, rb_set_pool_for_hash_callback, (VALUE)&arg);
return arg.set;
} else {
return rb_set_pool_if_swig_type_object(target, pool);
@@ -806,7 +813,7 @@ svn_swig_rb_set_pool_for_no_swig_type(VA
target = rb_ary_new3(1, target);
}
- rb_iterate((VALUE(*)())rb_each, target, (VALUE(*)())rb_set_pool, pool);
+ rb_iterate(rb_each, target, rb_set_pool_callback, pool);
}
void
@@ -1028,9 +1035,10 @@ typedef struct prop_hash_each_arg_t {
} prop_hash_each_arg_t;
static int
-svn_swig_rb_to_apr_array_row_prop_callback(VALUE key, VALUE value,
- prop_hash_each_arg_t *arg)
+svn_swig_rb_to_apr_array_row_prop_callback(VALUE key, VALUE value, VALUE
+ prop_arg)
{
+ prop_hash_each_arg_t *arg = (prop_hash_each_arg_t *) prop_arg;
svn_prop_t *prop;
prop = apr_array_push(arg->array);
@@ -1071,7 +1079,7 @@ svn_swig_rb_to_apr_array_row_prop(VALUE
arg.array = result;
arg.pool = pool;
rb_hash_foreach(array_or_hash,
- (int(*)(ANYARGS))svn_swig_rb_to_apr_array_row_prop_callback,
+ svn_swig_rb_to_apr_array_row_prop_callback,
(VALUE)&arg);
return result;
} else {
@@ -1082,9 +1090,9 @@ svn_swig_rb_to_apr_array_row_prop(VALUE
}
static int
-svn_swig_rb_to_apr_array_prop_callback(VALUE key, VALUE value,
- prop_hash_each_arg_t *arg)
+svn_swig_rb_to_apr_array_prop_callback(VALUE key, VALUE value, VALUE prop_arg)
{
+ prop_hash_each_arg_t *arg = (prop_hash_each_arg_t *) prop_arg;
svn_prop_t *prop;
prop = apr_palloc(arg->pool, sizeof(svn_prop_t));
@@ -1127,7 +1135,7 @@ svn_swig_rb_to_apr_array_prop(VALUE arra
arg.array = result;
arg.pool = pool;
rb_hash_foreach(array_or_hash,
- (int(*)(ANYARGS))svn_swig_rb_to_apr_array_prop_callback,
+ svn_swig_rb_to_apr_array_prop_callback,
(VALUE)&arg);
return result;
} else {
@@ -1525,8 +1533,9 @@ svn_swig_rb_apr_revnum_key_hash_to_hash_
/* Ruby Hash -> apr_hash_t */
static int
-r2c_hash_i(VALUE key, VALUE value, hash_to_apr_hash_data_t *data)
+r2c_hash_i(VALUE key, VALUE value, VALUE data_arg)
{
+ hash_to_apr_hash_data_t *data = (hash_to_apr_hash_data_t *) data_arg;
if (key != Qundef) {
void *val = data->func(value, data->ctx, data->pool);
svn_hash_sets(data->apr_hash, apr_pstrdup(data->pool, StringValuePtr(key)),
@@ -1550,7 +1559,7 @@ r2c_hash(VALUE hash, r2c_func func, void
data.func = func;
data.pool = pool;
- rb_hash_foreach(hash, (int(*)(ANYARGS))r2c_hash_i, (VALUE)&data);
+ rb_hash_foreach(hash, r2c_hash_i, (VALUE)&data);
return apr_hash;
}
@@ -1609,7 +1618,7 @@ typedef struct callback_handle_error_bat
} callback_handle_error_baton_t;
static VALUE
-callback(VALUE baton, ...)
+callback(VALUE baton)
{
callback_baton_t *cbb = (callback_baton_t *)baton;
VALUE result;
@@ -1621,7 +1630,7 @@ callback(VALUE baton, ...)
}
static VALUE
-callback_rescue(VALUE baton, ...)
+callback_rescue(VALUE baton, VALUE unused)
{
callback_rescue_baton_t *rescue_baton = (callback_rescue_baton_t*)baton;
@@ -1638,7 +1647,7 @@ callback_rescue(VALUE baton, ...)
}
static VALUE
-callback_ensure(VALUE pool, ...)
+callback_ensure(VALUE pool)
{
svn_swig_rb_pop_pool(pool);
@@ -1655,19 +1664,18 @@ invoke_callback(VALUE baton, VALUE pool)
argv[0] = pool;
svn_swig_rb_get_pool(1, argv, Qnil, &subpool, NULL);
cbb->pool = subpool;
- return rb_ensure((VALUE(*)(ANYARGS))callback, baton,
- (VALUE(*)(ANYARGS))callback_ensure, subpool);
+ return rb_ensure(callback, baton, callback_ensure, subpool);
}
static VALUE
-callback_handle_error(VALUE baton, ...)
+callback_handle_error(VALUE baton)
{
callback_handle_error_baton_t *handle_error_baton;
handle_error_baton = (callback_handle_error_baton_t *)baton;
- return rb_rescue2((VALUE(*)(ANYARGS))callback,
+ return rb_rescue2(callback,
(VALUE)(handle_error_baton->callback_baton),
- (VALUE(*)(ANYARGS))callback_rescue,
+ callback_rescue,
(VALUE)(handle_error_baton->rescue_baton),
rb_svn_error(),
(VALUE)0);
@@ -1686,9 +1694,8 @@ invoke_callback_handle_error(VALUE baton
handle_error_baton.callback_baton = cbb;
handle_error_baton.rescue_baton = &rescue_baton;
- return rb_ensure((VALUE(*)(ANYARGS))callback_handle_error,
- (VALUE)&handle_error_baton,
- (VALUE(*)(ANYARGS))callback_ensure, pool);
+ return rb_ensure(callback_handle_error, (VALUE)&handle_error_baton,
+ callback_ensure, pool);
}
@@ -1721,7 +1728,7 @@ make_baton(apr_pool_t *pool, VALUE edito
}
static VALUE
-add_baton_if_delta_editor(VALUE target, VALUE baton)
+add_baton_if_delta_editor(RB_BLOCK_CALL_FUNC_ARGLIST(target, baton))
{
if (RTEST(rb_obj_is_kind_of(target, svn_swig_rb_svn_delta_editor()))) {
add_baton(target, baton);
@@ -1741,8 +1748,7 @@ svn_swig_rb_set_baton(VALUE target, VALU
target = rb_ary_new3(1, target);
}
- rb_iterate((VALUE(*)())rb_each, target,
- (VALUE(*)())add_baton_if_delta_editor, baton);
+ rb_iterate(rb_each, target, add_baton_if_delta_editor, baton);
}
Modified: subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h Sat Apr 5 04:00:20 2025
@@ -57,7 +57,9 @@ typedef int gid_t;
#if !defined(__cplusplus) && !defined(inline)
#define inline __inline
#endif
-typedef long ssize_t;
+#ifndef HAVE_SSIZE_T
+typedef apr_ssize_t ssize_t;
+#endif
/* Don't define iovec when including APR */
#define APR_IOVEC_DEFINED
@@ -92,6 +94,10 @@ typedef unsigned __int64 uint64_t;
#ifdef _MSC_VER
#pragma warning(disable: 4702) /* warning C4702: unreachable code */
+#if SWIG_VERSION < 0x040002
+/* Prevent C4113 "X differs in parameter lists from Y" errors */
+# pragma warning(default : 4113)
+#endif
#endif
#endif /* defined(SVN_SWIG_RUBY__CUSTOM_RUBY_CONFIG) && defined(_MSC_VER) */
Modified: subversion/branches/1.14.x/subversion/bindings/swig/ruby/svn/util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/ruby/svn/util.rb?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/ruby/svn/util.rb (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/ruby/svn/util.rb Sat Apr 5 04:00:20 2025
@@ -17,7 +17,7 @@
# under the License.
# ====================================================================
-if /cygwin|mingw|mswin32|bccwin32/.match(RUBY_PLATFORM)
+if /cygwin|mingw|mswin|bccwin32/.match(RUBY_PLATFORM)
$LOAD_PATH.each do |load_path|
svn_ext_path = File.join(load_path, "svn", "ext")
if File.exist?(svn_ext_path)
@@ -122,7 +122,7 @@ EOC
end
def reset_message_directory
- if /cygwin|mingw|mswin32|bccwin32/.match(RUBY_PLATFORM)
+ if /cygwin|mingw|mswin|bccwin32/.match(RUBY_PLATFORM)
top_directory = File.join(File.dirname(__FILE__), "..", "..")
top_directory = File.expand_path(top_directory)
locale_directory = File.join(top_directory, "share", "locale")
@@ -147,7 +147,7 @@ EOC
end
def windows?
- /cygwin|mingw|mswin32|bccwin32/.match(RUBY_PLATFORM)
+ /cygwin|mingw|mswin|bccwin32/.match(RUBY_PLATFORM)
end
end
end
Modified: subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_fs.rb
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_fs.rb?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_fs.rb (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_fs.rb Sat Apr 5 04:00:20 2025
@@ -219,18 +219,14 @@ class SvnFsTest < Test::Unit::TestCase
end
start_time = Time.now
+ sleep 0.032r if Svn::Util::windows?
txn1 = @fs.transaction
assert_equal([Svn::Core::PROP_REVISION_DATE], txn1.proplist.keys)
assert_instance_of(Time, txn1.proplist[Svn::Core::PROP_REVISION_DATE])
date = txn1.prop(Svn::Core::PROP_REVISION_DATE)
- # Subversion's clock is more precise than Ruby's on
- # Windows. So this test can fail intermittently because
- # the begin and end of the range are the same (to 3
- # decimal places), but the time from Subversion has 6
- # decimal places so it looks like it's not in the range.
- # So we just add a smidgen to the end of the Range.
- assert_operator(start_time..(Time.now + 0.001), :include?, date)
+ sleep 0.032r if Svn::Util::windows?
+ assert_operator(start_time..Time.now, :include?, date)
txn1.set_prop(Svn::Core::PROP_REVISION_DATE, nil)
assert_equal([], txn1.proplist.keys)
assert_equal(youngest_rev, txn1.base_revision)
@@ -420,10 +416,12 @@ class SvnFsTest < Test::Unit::TestCase
ctx.mkdir(["#{@wc_path}/new_dir"])
start_time = Time.now
+ sleep 0.032r if Svn::Util::windows?
info = ctx.commit([@wc_path])
assert_equal(@author, info.author)
assert_equal(@fs.youngest_rev, info.revision)
+ sleep 0.032r if Svn::Util::windows?
assert_operator(start_time..(Time.now), :include?, info.date)
assert_equal(@author, @fs.prop(Svn::Core::PROP_REVISION_AUTHOR))
Modified: subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_repos.rb
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_repos.rb?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_repos.rb (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/test_repos.rb Sat Apr 5 04:00:20 2025
@@ -279,6 +279,7 @@ class SvnReposTest < Test::Unit::TestCas
assert_equal(prev_rev, @repos.youngest_rev)
assert_equal(prev_rev, @repos.dated_revision(past_date))
+ sleep 0.032r if Svn::Util::windows?
prev_rev = @repos.youngest_rev
@repos.transaction_for_commit(@author, log) do |txn|
end
Modified: subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/windows_util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/windows_util.rb?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/windows_util.rb (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/ruby/test/windows_util.rb Sat Apr 5 04:00:20 2025
@@ -38,30 +38,25 @@ module SvnTestUtil
@svnserve_port = @svnserve_ports.last
@repos_svnserve_uri = "svn://#{@svnserve_host}:#{@svnserve_port}"
- @@service_created ||= begin
- @@service_created = true
+ top_directory = File.join(File.dirname(__FILE__), "..", "..", "..", "..", "..")
+ build_type = ENV["BUILD_TYPE"] || "Release"
+ svnserve_path = File.join(top_directory, build_type, 'subversion', 'svnserve', 'svnserve.exe')
+ svnserve_path = Svnserve.escape_value(svnserve_path)
+
+ root = @full_repos_path.tr(File::SEPARATOR, File::ALT_SEPARATOR)
+ FileUtils.mkdir_p(root)
+
+ IO.popen("#{svnserve_path} -d -r #{Svnserve.escape_value(root)} --listen-host #{@svnserve_host} --listen-port #{@svnserve_port} --pid-file #{@svnserve_pid_file}")
+
+ # Give svnserve a bit of time to start
+ sleep 1
- top_directory = File.join(File.dirname(__FILE__), "..", "..", "..", "..", "..")
- build_type = ENV["BUILD_TYPE"] || "Release"
- svnserve_path = File.join(top_directory, build_type, 'subversion', 'svnserve', 'svnserve.exe')
- svnserve_path = Svnserve.escape_value(svnserve_path)
-
- root = @full_repos_path.tr(File::SEPARATOR, File::ALT_SEPARATOR)
- FileUtils.mkdir_p(root)
-
- IO.popen("#{svnserve_path} -d -r #{Svnserve.escape_value(root)} --listen-host #{@svnserve_host} --listen-port #{@svnserve_port} --pid-file #{@svnserve_pid_file}")
- user = ENV["USERNAME"] || Etc.getlogin
-
- # Give svnserve a bit of time to start
- sleep 1
- end
true
end
def teardown_svnserve
- # TODO:
- # Load @svnserve_pid_file
- # Kill process
+ pid = File.read(@svnserve_pid_file).to_i
+ Process.kill(:KILL, pid)
end
def add_pre_revprop_change_hook
Modified: subversion/branches/1.14.x/subversion/bindings/swig/svn_delta.i
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/svn_delta.i?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/svn_delta.i (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/svn_delta.i Sat Apr 5 04:00:20 2025
@@ -273,7 +273,7 @@ svn_swig_rb_delta_editor_get_target_revi
if (NIL_P(rb_target_address))
return Qnil;
- target_address = (svn_revnum_t *)(NUM2LONG(rb_target_address));
+ target_address = (svn_revnum_t *)(NUM2SWIG(rb_target_address));
if (!target_address)
return Qnil;
Modified: subversion/branches/1.14.x/subversion/bindings/swig/svn_wc.i
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/bindings/swig/svn_wc.i?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/bindings/swig/svn_wc.i (original)
+++ subversion/branches/1.14.x/subversion/bindings/swig/svn_wc.i Sat Apr 5 04:00:20 2025
@@ -232,7 +232,7 @@
%typemap(argout) svn_revnum_t *target_revision
{
- %append_output(LONG2NUM((long)$1));
+ %append_output(SWIG2NUM($1));
}
#endif
Modified: subversion/branches/1.14.x/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/win-tests.py?rev=1924796&r1=1924795&r2=1924796&view=diff
==============================================================================
--- subversion/branches/1.14.x/win-tests.py (original)
+++ subversion/branches/1.14.x/win-tests.py Sat Apr 5 04:00:20 2025
@@ -1333,7 +1333,7 @@ elif test_swig == 'ruby':
ruby_args = [
'-I', os.path.join(abs_srcdir, ruby_subdir),
os.path.join(abs_srcdir, ruby_subdir, 'test', 'run-test.rb'),
- '--verbose'
+ '--collector=dir', '--verbose',
]
print('-- Running Swig Ruby tests --')
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.