blib/lib/Perl/Structure/Hash_cpp.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 52 CC 5 SCAR 28.7
CC
5
Cov
0%
cpp_load
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 17.6
1 # [[[ HEADER ]]]
2 package Perl::Structure::Hash_cpp;
3 use strict;
4 use warnings;
5 use Perl::Types;
6 our $VERSION = 0.005_000;
7  
8 # [[[ CRITICS ]]]
9 ## no critic qw(ProhibitStringyEval) # SYSTEM DEFAULT 1: allow eval()
10  
11 # [[[ INCLUDES ]]]
12 use Perl::Inline;
13  
14 # [[[ SUBROUTINES ]]]
15 sub cpp_load {
16 { my void $RETURN_TYPE };
17 my $need_load_cpp = 0;
18 if ( ( exists $main::{'Perl__Structure__Hash__MODE_ID'} )
19 and ( defined &{ $main::{'Perl__Structure__Hash__MODE_ID'} } ) )
20 {
21 # Perl::diag("in Hash_cpp::cpp_load, Perl__Structure__Hash__MODE_ID() exists & defined\n");
22 # Perl::diag(q{in Hash_cpp::cpp_load, have Perl__Structure__Hash__MODE_ID() retval = '} . main::Perl__Structure__Hash__MODE_ID() . "'\n");
23 if ( $Perl::MODES->{main::Perl__Structure__Hash__MODE_ID()}->{ops} ne 'CPP' ) {
24 $need_load_cpp = 1;
25 }
26 }
27 else {
28 # Perl::diag("in Hash_cpp::cpp_load, Perl__Structure__Hash__MODE_ID() does not exist or undefined\n");
29 $need_load_cpp = 1;
30 }
31  
32 if ($need_load_cpp) {
33  
34 # Perl::diag("in Hash_cpp::cpp_load, need load CPP code\n");
35  
36 my $eval_string = <<"EOF";
37 package main;
38 use Perl::Inline;
39 BEGIN { Perl::diag("[[[ BEGIN 'use Inline' STAGE for 'Perl/Structure/Hash.cpp' ]]]\n" x 0); }
40 use Inline (CPP => '$main::INCLUDE_PATH' . '/Perl/Structure/Hash.cpp', \%Perl::Inline::ARGS);
41 Perl::diag("[[[ END 'use Inline' STAGE for 'Perl/Structure/Hash.cpp' ]]]\n" x 0);
42 1;
43 EOF
44  
45 $Perl::Inline::ARGS{ccflagsex} = $Perl::Inline::CCFLAGSEX . $Perl::TYPES_CCFLAG . perltypessizes::type_integer_native_ccflag() . perltypessizes::type_number_native_ccflag();
46 $Perl::Inline::ARGS{cppflags} = $Perl::TYPES_CCFLAG . perltypessizes::type_integer_native_ccflag() . perltypessizes::type_number_native_ccflag();
47 # Perl::diag("in Hash_cpp::cpp_load(), CPP not yet loaded, about to call eval() on \$eval_string =\n<<< BEGIN EVAL STRING>>>\n" . $eval_string . "<<< END EVAL STRING >>>\n");
48  
49 eval $eval_string or croak( $OS_ERROR . "\n" . $EVAL_ERROR );
50 if ($EVAL_ERROR) { croak($EVAL_ERROR); }
51 }
52  
53 # else { Perl::diag("in Hash_cpp::cpp_load(), CPP already loaded, DOING NOTHING\n"); }
54 return;
55 }
56  
57 1; # end of package