Convert-Binary-C
view release on metacpan or search on metacpan
bin/ccconfig view on Meta::CPAN
);
unless( GetOptions( \%OPT, qw(
cc|c=s inc-path|I=s@ basename=s
output-file|o=s output-format|f=s
preprocess=s compile-obj=s compile-exe=s
obj-ext=s exe-ext=s c-ext=s pp-ext=s
version debug quiet status! run! delete!
) ) ) {
# poor man's pod2usage...
my($USAGE) = do { local(@ARGV,$/)=($0); <> }
=~ /^__END__.*?^=head\d\s+SYNOPSIS(.*?)^=/ms;
my %M = ( 'I' => '*' ); # minimal markup
$USAGE =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
$USAGE =~ s/^/ /gm;
print STDERR "\nUsage:$USAGE",
"Try `perldoc $NAME' for more information.\n\n";
exit 2;
}
if( $OPT{version} ) {
if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
my $hint = $hints{$func};
$hint =~ s/^/ /mg;
print " --- hint for $func ---\n", $hint;
}
$rv || 0;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
Usage: $usage
See perldoc $0 for details.
ENDUSAGE
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
eval { require Devel::PPPort };
\$@ and die "Cannot require Devel::PPPort, please install.\\n";
if (eval \$Devel::PPPort::VERSION < $VERSION) {
die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
. "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
tests/602_threads.t view on Meta::CPAN
my @structs = $p->struct;
my @unions = $p->union;
my @typedefs = $p->typedef;
@enums == 12 or return "incorrect number of enums";
@compounds == 26 or return "incorrect number of compounds";
@structs == 20 or return "incorrect number of structs";
@unions == 6 or return "incorrect number of unions";
@typedefs == 54 or return "incorrect number of typedefs";
my %size = do { local (@ARGV, $/) = ('tests/include/sizeof.pl'); eval <> };
my $max_size = 0;
my @fail = ();
local $SIG{__WARN__} = sub {
print "# unexpected warning: $_[0]";
push @fail, $_[0];
};
for my $t (keys %size) {
my $s = eval { $p->sizeof($t) };
( run in 0.561 second using v1.01-cache-2.11-cpan-49f99fa48dc )