Algorithm-ConsistentHash-Ketama

 view release on metacpan or  search on metacpan

inc/Module/Install/XSUtil.pm  view on Meta::CPAN

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
sub want_xs {
    my($self, $default) = @_;
    return $want_xs if defined $want_xs;
 
    # you're using this module, you must want XS by default
    # unless PERL_ONLY is true.
    $default = !$ENV{PERL_ONLY} if not defined $default;
 
    foreach my $arg(@ARGV){
 
        my ($k, $v) = split '=', $arg; # MM-style named args
        if ($k eq 'PUREPERL_ONLY' && defined $v) {
            return $want_xs = !$v;
        }
        elsif($arg eq '--pp'){ # old-style
            return $want_xs = 0;
        }
        elsif($arg eq '--xs'){
            return $want_xs = 1;
        }
    }
 
    if ($ENV{PERL_MM_OPT}) {
        my($v) = $ENV{PERL_MM_OPT} =~ /\b PUREPERL_ONLY = (\S+) /xms;
        if (defined $v) {

inc/Module/Install/XSUtil.pm  view on Meta::CPAN

231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    return 0 if not $self->cc_available();
 
    require File::Temp;
    require File::Basename;
 
    my $tmpfile = File::Temp->new(SUFFIX => '.c');
 
    $tmpfile->print(<<'C99');
// include a C99 header
#include <stdbool.h>
inline // a C99 keyword with C99 style comments
int test_c99() {
    int i = 0;
    i++;
    int j = i - 1; // another C99 feature: declaration after statement
    return j;
}
C99
 
    $tmpfile->close();



( run in 0.268 second using v1.01-cache-2.11-cpan-95122f20152 )