Permalink
Browse files

[pmc2c] WIP - rurban's patch to correct headers. GH parrot#1083

  • Loading branch information...
ZYROz committed Jul 29, 2014
1 parent 55ce822 commit a036b400e4bc2e2d5155e968c32adf2ea78db549
Showing with 10 additions and 4 deletions.
  1. +2 −1 lib/Parrot/Pmc2c/Method.pm
  2. +8 −3 lib/Parrot/Pmc2c/PMC.pm
@@ -337,9 +337,10 @@ sub decl {
}
my $interp = $self->interp_unused ? 'SHIM_INTERP' : 'PARROT_INTERP';
my $pmcarg = $self->pmc_unused ? 'SHIM(PMC *_self)' : 'ARGMOD(PMC *_self)';
my $static = $pmcname eq 'CallContext' ? "" : "static";
return <<"EOC";
static $decs $ret${newl}Parrot_${pmcname}_$meth($interp, $pmcarg$args)$semi
$static $decs $ret${newl}Parrot_${pmcname}_$meth($interp, $pmcarg$args)$semi
EOC
}
View
@@ -1,4 +1,4 @@
# Copyright (C) 2004-2013, Parrot Foundation.
# Copyright (C) 2004-2014, Parrot Foundation.
=head1 NAME
@@ -521,7 +521,7 @@ sub generate_c_file {
$c->emit( $self->preamble );
$c->emit( $self->hdecls );
$c->emit( $self->hdecls ) unless $self->name eq 'CallContext';
$c->emit( $self->{ro}->hdecls ) if ( $self->{ro} );
$self->gen_methods;
@@ -589,6 +589,10 @@ EOH
$self->gen_attributes;
if ($name eq 'CallContext') {
$h->emit( $self->hdecls );
}
if ($self->is_dynamic) {
$h->emit(<<"EOH");
@@ -1744,7 +1748,8 @@ sub generate_accessor {
/* Generated macro accessors for '$attrname' attribute of $pmcname PMC. */
#define GETATTR_${pmcname}_${attrname}(interp, pmc, dest) \\
EOA
if (${pmcname} eq "CallContext") {
# Nobody derives from CallContext, the arg is always proper, and we need the speed
if ($pmcname eq "CallContext") {
$decl .= <<"EOA";
(dest) = PARROT_CALLCONTEXT(pmc)->${attrname};

0 comments on commit a036b40

Please sign in to comment.