Skip to content

Commit

Permalink
initial patch from gerdr++ for issue #236
Browse files Browse the repository at this point in the history
This shouldn't go into master without some discussion and iteration.
  • Loading branch information
cotto committed Dec 20, 2011
1 parent 80e365d commit 2443cc6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions config/auto/memalign.pm
Expand Up @@ -76,12 +76,27 @@ sub _set_malloc_header {

sub _set_ptrcast {
my $conf = shift;
if ( $conf->data->get('ptrsize') == $conf->data->get('intsize') ) {
$conf->data->set( ptrcast => 'int' );

my $ptrsize = $conf->data->get('ptrsize');
my $ptrcast = $conf->data->get("int${ptrsize}_t");

# FIXME: find out if this actually does the right thing if intXX_t is
# not available
if ( defined $ptrcast ) {}
elsif ( $ptrsize == $conf->data->get('intsize') ) {
$ptrcast = 'int';
}
elsif ( $ptrsize == $conf->data->get('longsize') ) {
$ptrcast = 'long';
}
elsif ( $ptrsize == $conf->data->get('longlongsize') ) {
$ptrcast = 'long long';
}
else {
$conf->data->set( ptrcast => 'long' );
# TODO: fail properly
}

$conf->data->set( ptrcast => $ptrcast );
}

sub _set_memalign {
Expand Down

0 comments on commit 2443cc6

Please sign in to comment.