Skip to content

Commit 5034cac

Browse files
committed
Add some duplication to makedef.pl from perl.h
There is unfortunately some duplication required in makedef.pl copied from perl.h. This adds some more for two variables, required for the next commit, which will remove far more lines from makedef.pl than this adds
1 parent 935cdb7 commit 5034cac

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

makedef.pl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,15 @@ BEGIN
211211
$define{USE_PERL_SWITCH_LOCALE_CONTEXT} = 1;
212212
}
213213

214+
# enable PERL_COPY_ON_WRITE by default
215+
$define{PERL_COPY_ON_WRITE} = 1 unless $define{PERL_NO_COW};
216+
if ($define{PERL_COPY_ON_WRITE}) {
217+
$define{PERL_ANY_COW} = 1;
218+
}
219+
else {
220+
$define{PERL_SAWAMPERSAND} = 1;
221+
}
222+
214223
# perl.h logic duplication ends
215224
#==========================================================================
216225

@@ -371,10 +380,6 @@ sub readvar {
371380
);
372381
}
373382

374-
if (!$define{'PERL_COPY_ON_WRITE'} || $define{'PERL_NO_COW'}) {
375-
++$skip{Perl_sv_setsv_cow};
376-
}
377-
378383
unless ($define{PERL_SAWAMPERSAND}) {
379384
++$skip{PL_sawampersand};
380385
}

perl.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,17 @@ typedef enum {
13251325
# endif
13261326
#endif /* End of USE_LOCALE */
13271327

1328+
/* enable PERL_COPY_ON_WRITE by default */
1329+
#if !defined(PERL_COPY_ON_WRITE) && !defined(PERL_NO_COW)
1330+
# define PERL_COPY_ON_WRITE
1331+
#endif
1332+
1333+
#ifdef PERL_COPY_ON_WRITE
1334+
# define PERL_ANY_COW
1335+
#else
1336+
# define PERL_SAWAMPERSAND
1337+
#endif
1338+
13281339
/* end of makedef.pl logic duplication
13291340
* ========================================================================= */
13301341

@@ -3218,17 +3229,6 @@ typedef struct padname PADNAME;
32183229
# define PERL_OP_PARENT
32193230
#endif
32203231

3221-
/* enable PERL_COPY_ON_WRITE by default */
3222-
#if !defined(PERL_COPY_ON_WRITE) && !defined(PERL_NO_COW)
3223-
# define PERL_COPY_ON_WRITE
3224-
#endif
3225-
3226-
#ifdef PERL_COPY_ON_WRITE
3227-
# define PERL_ANY_COW
3228-
#else
3229-
# define PERL_SAWAMPERSAND
3230-
#endif
3231-
32323232
#if defined(PERL_DEBUG_READONLY_OPS) && !defined(USE_ITHREADS)
32333233
# error PERL_DEBUG_READONLY_OPS only works with ithreads
32343234
#endif

0 commit comments

Comments
 (0)