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
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
13CAT2(sv_setsv_cow_hashkey_, SUFFIX) () {
14 dTHX;
15 SV *source = newSVpvn_share("pie", 3, 0);
16 SV *destination = newSV(0);
17 bool result;
18
19 if(!SvIsCOW(source)) {
20 SvREFCNT_dec(source);
21 Perl_croak(aTHX_ "Creating a shared hash key scalar failed when "
22 STRINGIFY(SUFFIX) " got flags %"UVxf, (UV)SvFLAGS(source));
23 }
24
25 sv_setsv(destination, source);
26
27 result = !!SvIsCOW(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: nil
41 * End:
42 *
43 * ex: set ts=8 sts=4 sw=4 et:
44 */