Skip to content

Commit 4f79ddc

Browse files
atoomictoddr
authored andcommitted
threads: use PERL_VERSION compare macros
Use new core PERL_VERSION compare macros. When bumping thread with this change we would need to make sure to use the last version of ppport.h
1 parent a4582d5 commit 4f79ddc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

dist/threads/lib/threads.pm

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

8-
our $VERSION = '2.25'; # remember to update version in POD!
8+
our $VERSION = '2.26'; # remember to update version in POD!
99
my $XS_VERSION = $VERSION;
1010
$VERSION = eval $VERSION;
1111

@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
134134
135135
=head1 VERSION
136136
137-
This document describes threads version 2.25
137+
This document describes threads version 2.26
138138
139139
=head1 WARNING
140140

dist/threads/threads.xs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ STATIC const MGVTBL ithread_vtbl = {
421421
ithread_mg_free, /* free */
422422
0, /* copy */
423423
ithread_mg_dup, /* dup */
424-
#if (PERL_VERSION > 8) || (PERL_VERSION == 8 && PERL_SUBVERSION > 8)
424+
#if PERL_VERSION_GT(5,8,8)
425425
0 /* local */
426426
#endif
427427
};
@@ -751,7 +751,7 @@ S_ithread_create(
751751
AV *params;
752752
SV **array;
753753

754-
#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
754+
#if PERL_VERSION_LE(5,8,7)
755755
SV **tmps_tmp = PL_tmps_stack;
756756
IV tmps_ix = PL_tmps_ix;
757757
#endif
@@ -849,7 +849,7 @@ S_ithread_create(
849849
* context for the duration of our work for new interpreter.
850850
*/
851851
{
852-
#if (PERL_VERSION > 13) || (PERL_VERSION == 13 && PERL_SUBVERSION > 1)
852+
#if PERL_VERSION_GE(5,13,2)
853853
CLONE_PARAMS *clone_param = Perl_clone_params_new(aTHX, thread->interp);
854854
#else
855855
CLONE_PARAMS clone_param_s;
@@ -859,7 +859,7 @@ S_ithread_create(
859859

860860
MY_CXT_CLONE;
861861

862-
#if (PERL_VERSION < 13) || (PERL_VERSION == 13 && PERL_SUBVERSION <= 1)
862+
#if PERL_VERSION_LT(5,13,2)
863863
clone_param->flags = 0;
864864
#endif
865865

@@ -886,7 +886,7 @@ S_ithread_create(
886886
perl_clone() and sv_dup_inc(). Hence copy the parameters
887887
somewhere under our control first, before duplicating. */
888888
if (num_params) {
889-
#if (PERL_VERSION > 8)
889+
#if PERL_VERSION_GE(5,9,0)
890890
Copy(parent_perl->Istack_base + params_start, array, num_params, SV *);
891891
#else
892892
Copy(parent_perl->Tstack_base + params_start, array, num_params, SV *);
@@ -897,11 +897,11 @@ S_ithread_create(
897897
}
898898
}
899899

900-
#if (PERL_VERSION > 13) || (PERL_VERSION == 13 && PERL_SUBVERSION > 1)
900+
#if PERL_VERSION_GE(5,13,2)
901901
Perl_clone_params_del(clone_param);
902902
#endif
903903

904-
#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
904+
#if PERL_VERSION_LT(5,8,8)
905905
/* The code below checks that anything living on the tmps stack and
906906
* has been cloned (so it lives in the ptr_table) has a refcount
907907
* higher than 0.
@@ -1339,7 +1339,7 @@ ithread_join(...)
13391339
/* Get the return value from the call_sv */
13401340
/* Objects do not survive this process - FIXME */
13411341
if ((thread->gimme & G_WANT) != G_VOID) {
1342-
#if (PERL_VERSION < 13) || (PERL_VERSION == 13 && PERL_SUBVERSION <= 1)
1342+
#if PERL_VERSION_LT(5,13,2)
13431343
AV *params_copy;
13441344
PerlInterpreter *other_perl;
13451345
CLONE_PARAMS clone_params;
@@ -1766,7 +1766,7 @@ ithread_error(...)
17661766

17671767
/* If thread died, then clone the error into the calling thread */
17681768
if (thread->state & PERL_ITHR_DIED) {
1769-
#if (PERL_VERSION < 13) || (PERL_VERSION == 13 && PERL_SUBVERSION <= 1)
1769+
#if PERL_VERSION_LT(5,13,2)
17701770
PerlInterpreter *other_perl;
17711771
CLONE_PARAMS clone_params;
17721772
ithread *current_thread;

0 commit comments

Comments
 (0)