File Coverage

File:config/auto/socklen_t.pm
Coverage:97.6%

linestmtbrancondsubcode
1# Copyright (C) 2006-2007, Parrot Foundation.
2
3 - 11
=head1 NAME

config/auto/socklen_t.pm - Is there a socklen_t

=head1 DESCRIPTION

Determines whether there is a socklen_t

=cut
12
13package auto::socklen_t;
14
15
2
2
2
use strict;
16
2
2
2
use warnings;
17
18
19
2
2
2
use base qw(Parrot::Configure::Step);
20
21
2
2
2
use Parrot::Configure::Utils ':auto';
22
23sub _init {
24
3
    my $self = shift;
25
3
    my %data;
26
3
    $data{description} = q{Determine whether there is socklen_t};
27
3
    $data{result} = q{};
28
3
    return \%data;
29}
30
31sub runstep {
32
2
    my ( $self, $conf ) = @_;
33
34
2
    my $d_socklen_t = _probe_for_socklen_t($conf);
35
36
2
    $self->_evaluate_socklen_t($conf, $d_socklen_t);
37
38
2
    return 1;
39}
40
41sub _probe_for_socklen_t {
42
2
    my $conf = shift;
43
2
    return $conf->data->get('has_socklen_t')
44            ||
45           $conf->data->get('d_socklen_t_provisional');
46}
47
48sub _evaluate_socklen_t {
49
4
    my ($self, $conf, $d_socklen_t) = @_;
50
4
    my $has_socklen_t = $d_socklen_t ? 1 : 0;
51
4
    $self->set_result( $has_socklen_t ? 'yes' : 'no' );
52
4
    $conf->data->set( has_socklen_t => $has_socklen_t );
53}
54
551;
56
57# Local Variables:
58# mode: cperl
59# cperl-indent-level: 4
60# fill-column: 100
61# End:
62# vim: expandtab shiftwidth=4: