This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove unneeded 'use' from ext/XS-APItest/t/peep.t Devel::Peek is not used by ext...
[perl5.git] / ext / XS-APItest / core_or_not.inc
CommitLineData
3e8ab2ef
NC
1/* This code is compiled twice, once with -DPERL_CORE defined, once without */
2
3#include "EXTERN.h"
4#include "perl.h"
5
6#ifdef PERL_CORE
7# define SUFFIX core
8#else
9# define SUFFIX notcore
10#endif
11
12bool
ff66e713
SH
13CAT2(sv_setsv_cow_hashkey_, SUFFIX) () {
14 dTHX;
3e8ab2ef
NC
15 SV *source = newSVpvn_share("pie", 3, 0);
16 SV *destination = newSV(0);
17 bool result;
18
19 if(!SvREADONLY(source) && !SvFAKE(source)) {
20 SvREFCNT_dec(source);
2fcd17ed 21 Perl_croak(aTHX_ "Creating a shared hash key scalar failed when "
3e8ab2ef
NC
22 STRINGIFY(SUFFIX) " got flags %"UVxf, (UV)SvFLAGS(source));
23 }
24
25 sv_setsv(destination, source);
26
27 result = SvREADONLY(destination) && SvFAKE(destination);
28
29 SvREFCNT_dec(source);
30 SvREFCNT_dec(destination);
31
32 return result;
33}
34
35/*
36 * Local variables:
37 * mode: c
38 * c-indentation-style: bsd
39 * c-basic-offset: 4
40 * indent-tabs-mode: t
41 * End:
42 *
43 * ex: set ts=8 sts=4 sw=4 noet:
44 */