Skip to content

Commit 487e1e2

Browse files
committed
print got_complex_version results during build helping track freebsd fails
1 parent e56a873 commit 487e1e2

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

lib/PDL/Math.pd

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,15 @@ PDL_IF_BAD(if ( \$ISBAD($x()) || \$ISBAD($y()) ) { \$SETBAD($c()); } else,)
200200
EOF
201201
}
202202

203+
sub g_c {
204+
my ($func, $arg) = @_;
205+
$got_complex{$func} = PDL::Core::Dev::got_complex_version($func, $arg);
206+
print "got_complex_version($func, $arg): $got_complex{$func}\n";
207+
$got_complex{$func};
208+
}
209+
203210
foreach my $func (@ufuncs1) {
204-
my $got_complex = $got_complex{$func} = PDL::Core::Dev::got_complex_version($func, 1);
211+
my $got_complex = g_c($func, 1);
205212
pp_def($func,
206213
HandleBad => 1,
207214
NoBadifNaN => 1,
@@ -225,7 +232,7 @@ foreach my $func (@ufuncs1g) {
225232
}
226233

227234
foreach my $func (@bifuncs1) {
228-
my $got_complex = $got_complex{$func} = PDL::Core::Dev::got_complex_version($func, 2);
235+
my $got_complex = g_c($func, 2);
229236
pp_def($func,
230237
HandleBad => 1,
231238
NoBadifNaN => 1,
@@ -492,7 +499,7 @@ works with native-complex data.
492499

493500
sub cequiv {
494501
my ($func, $ref) = @_;
495-
return if !($got_complex{$func} = PDL::Core::Dev::got_complex_version($func, 1));
502+
return if !g_c($func, 1);
496503
pp_def("c$func",
497504
GenericTypes => $AF,
498505
Pars => 'i(); complex [o] o()',

lib/PDL/Ops.pd

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,21 @@ EOF
152152
);
153153
}
154154

155+
sub g_c {
156+
my ($func, $arg) = @_;
157+
$got_complex{$func} = PDL::Core::Dev::got_complex_version($func, $arg);
158+
print "got_complex_version($func, $arg): $got_complex{$func}\n";
159+
$got_complex{$func};
160+
}
161+
155162
#simple binary functions
156163
sub bifunc {
157164
my ($name,$func,$mutator,$doc,%extra) = @_;
158165
my $funcov = ref $func eq 'ARRAY' ? $func->[1] : $func;
159166
my $isop = $funcov =~ s/^op//;
160167
my $funcovp = protect_chars $funcov;
161168
$func = $func->[0] if ref $func eq 'ARRAY';
162-
my $got_complex = $got_complex{$func} = PDL::Core::Dev::got_complex_version($func, 2);
169+
my $got_complex = g_c($func, 2);
163170
$extra{GenericTypes} = [ grep exists $is_real{$_}, @{$extra{GenericTypes}} ]
164171
if !$got_complex and $extra{GenericTypes};
165172
$extra{HdrCode} .= << 'EOH';
@@ -216,7 +223,7 @@ sub ufunc {
216223
my $funcov = ref $func eq 'ARRAY' ? $func->[1] : $func;
217224
my $funcovp = protect_chars $funcov;
218225
$func = $func->[0] if ref $func eq 'ARRAY';
219-
my $got_complex = $got_complex{$func} = PDL::Core::Dev::got_complex_version($func, 1);
226+
my $got_complex = g_c($func, 1);
220227
$extra{GenericTypes} = [ grep exists $is_real{$_}, @{$extra{GenericTypes}} ]
221228
if !$got_complex and $extra{GenericTypes};
222229

0 commit comments

Comments
 (0)