diff --git a/makedef.pl b/makedef.pl index a77c2b3745..e95c04a791 100644 --- a/makedef.pl +++ b/makedef.pl @@ -211,6 +211,15 @@ if ($define{MULTIPLICITY} && ( $define{USE_POSIX_2008_LOCALE} $define{USE_PERL_SWITCH_LOCALE_CONTEXT} = 1; } +# enable PERL_COPY_ON_WRITE by default +$define{PERL_COPY_ON_WRITE} = 1 unless $define{PERL_NO_COW}; +if ($define{PERL_COPY_ON_WRITE}) { + $define{PERL_ANY_COW} = 1; +} +else { + $define{PERL_SAWAMPERSAND} = 1; +} + # perl.h logic duplication ends #========================================================================== @@ -371,10 +380,6 @@ else { ); } -if (!$define{'PERL_COPY_ON_WRITE'} || $define{'PERL_NO_COW'}) { - ++$skip{Perl_sv_setsv_cow}; -} - unless ($define{PERL_SAWAMPERSAND}) { ++$skip{PL_sawampersand}; } diff --git a/perl.h b/perl.h index 427a05c1c6..f63e298a32 100644 --- a/perl.h +++ b/perl.h @@ -1325,6 +1325,17 @@ typedef enum { # endif #endif /* End of USE_LOCALE */ +/* enable PERL_COPY_ON_WRITE by default */ +#if !defined(PERL_COPY_ON_WRITE) && !defined(PERL_NO_COW) +# define PERL_COPY_ON_WRITE +#endif + +#ifdef PERL_COPY_ON_WRITE +# define PERL_ANY_COW +#else +# define PERL_SAWAMPERSAND +#endif + /* end of makedef.pl logic duplication * ========================================================================= */ @@ -3218,17 +3229,6 @@ typedef struct padname PADNAME; # define PERL_OP_PARENT #endif -/* enable PERL_COPY_ON_WRITE by default */ -#if !defined(PERL_COPY_ON_WRITE) && !defined(PERL_NO_COW) -# define PERL_COPY_ON_WRITE -#endif - -#ifdef PERL_COPY_ON_WRITE -# define PERL_ANY_COW -#else -# define PERL_SAWAMPERSAND -#endif - #if defined(PERL_DEBUG_READONLY_OPS) && !defined(USE_ITHREADS) # error PERL_DEBUG_READONLY_OPS only works with ithreads #endif