Skip to content

Commit a2fa09f

Browse files
author
Jerry D. Hedden
authored
Merge pull request #6 from Dual-Life/develop
1.58 Clang macros
2 parents 0968cb8 + 48dd280 commit a2fa09f

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Revision history for Perl extension threads::shared.
33
-
44
-
55

6+
1.58 Mon Jan 22 20:09:07 EST 2018
7+
- Fix CLANG macros.
8+
- Sync with blead.
9+
610
1.57 Sun May 7 22:48:33 2017
711
- Fix Clang macro backward compatibility per patch by Andy Grundman
812

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
threads::shared version 1.57
1+
threads::shared version 1.58
22
============================
33

44
This module needs Perl 5.8.0 or later compiled with USEITHREADS.

lib/threads/shared.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use warnings;
77

88
use Scalar::Util qw(reftype refaddr blessed);
99

10-
our $VERSION = '1.57'; # Please update the pod, too.
10+
our $VERSION = '1.58'; # Please update the pod, too.
1111
my $XS_VERSION = $VERSION;
1212
$VERSION = eval $VERSION;
1313

@@ -195,7 +195,7 @@ threads::shared - Perl extension for sharing data structures between threads
195195
196196
=head1 VERSION
197197
198-
This document describes threads::shared version 1.57
198+
This document describes threads::shared version 1.58
199199
200200
=head1 SYNOPSIS
201201

shared.xs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@
128128
# include "shared.h"
129129
#endif
130130

131+
#ifndef CLANG_DIAG_IGNORE
132+
# define CLANG_DIAG_IGNORE(x)
133+
# define CLANG_DIAG_RESTORE
134+
#endif
135+
#ifndef CLANG_DIAG_IGNORE_STMT
136+
# define CLANG_DIAG_IGNORE_STMT(x) CLANG_DIAG_IGNORE(x) NOOP
137+
# define CLANG_DIAG_RESTORE_STMT CLANG_DIAG_RESTORE NOOP
138+
#endif
139+
131140
#ifdef USE_ITHREADS
132141

133142
/* Magic signature(s) for mg_private to make PERL_MAGIC_ext magic safer */
@@ -656,17 +665,10 @@ Perl_sharedsv_cond_timedwait(perl_cond *cond, perl_mutex *mut, double abs)
656665
abs -= (NV)ts.tv_sec;
657666
ts.tv_nsec = (long)(abs * 1000000000.0);
658667

659-
#if defined(CLANG_DIAG_IGNORE)
660-
CLANG_DIAG_IGNORE(-Wthread-safety);
668+
CLANG_DIAG_IGNORE_STMT(-Wthread-safety);
661669
/* warning: calling function 'pthread_cond_timedwait' requires holding mutex 'mut' exclusively [-Wthread-safety-analysis] */
662-
#endif
663-
664670
switch (pthread_cond_timedwait(cond, mut, &ts)) {
665-
666-
/* perl.h defines CLANG_DIAG_* but only in 5.24+ */
667-
#if defined(CLANG_DIAG_RESTORE)
668-
CLANG_DIAG_RESTORE;
669-
#endif
671+
CLANG_DIAG_RESTORE_STMT;
670672

671673
case 0: got_it = 1; break;
672674
case ETIMEDOUT: break;

t/test.pl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ sub find_git_or_skip {
212212
} else {
213213
$reason = 'not being run from a git checkout';
214214
}
215+
if ($ENV{'PERL_BUILD_PACKAGING'}) {
216+
$reason = 'PERL_BUILD_PACKAGING is set';
217+
}
215218
skip_all($reason) if $_[0] && $_[0] eq 'all';
216219
skip($reason, @_);
217220
}
@@ -860,7 +863,7 @@ sub unlink_all {
860863
if( -f $file ){
861864
_print_stderr "# Couldn't unlink '$file': $!\n";
862865
}else{
863-
++$count;
866+
$count = $count + 1; # don't use ++
864867
}
865868
}
866869
$count;
@@ -914,7 +917,7 @@ sub _num_to_alpha{
914917
my $tempfile_count = 0;
915918
sub tempfile {
916919
while(1){
917-
my $try = "tmp$$";
920+
my $try = (-d "t" ? "t/" : "")."tmp$$";
918921
my $alpha = _num_to_alpha($tempfile_count,2);
919922
last unless defined $alpha;
920923
$try = $try . $alpha;
@@ -1141,7 +1144,7 @@ sub setup_multiple_progs {
11411144
my $found;
11421145
while (<$fh>) {
11431146
if (/^__END__/) {
1144-
++$found;
1147+
$found = $found + 1; # don't use ++
11451148
last;
11461149
}
11471150
}
@@ -1516,6 +1519,7 @@ sub capture_warnings {
15161519

15171520
local @::__capture;
15181521
local $SIG {__WARN__} = \&__capture;
1522+
local $Level = 1;
15191523
&$code;
15201524
return @::__capture;
15211525
}

0 commit comments

Comments
 (0)