This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5216delta correction - IO::Socket has connected(), not isconnected()
[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
e3918bb7 19 if(!SvIsCOW(source)) {
3e8ab2ef 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
e3918bb7 27 result = !!SvIsCOW(destination);
3e8ab2ef
NC
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
14d04a33 40 * indent-tabs-mode: nil
3e8ab2ef
NC
41 * End:
42 *
14d04a33 43 * ex: set ts=8 sts=4 sw=4 et:
3e8ab2ef 44 */