From: Rafael Garcia-Suarez Date: Sun, 8 May 2005 12:19:51 +0000 (+0000) Subject: Tweak the insertion of __attribute__((nonnull())) declarations X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f728784643460445f91833d46f0c8bf60beb6583;p=p5sagit%2Fp5-mst-13.2.git Tweak the insertion of __attribute__((nonnull())) declarations in proto.h so it compiles with and without threads with gcc 3.4 p4raw-id: //depot/perl@24416 --- diff --git a/embed.pl b/embed.pl index 39bd429..6487ff4 100755 --- a/embed.pl +++ b/embed.pl @@ -212,8 +212,23 @@ sub write_protos { } $ret .= "\n\t\t\t__attribute__((nonnull))" if $flags =~ /N/; if ( @nonnull ) { - my @pos = map { $has_context ? "pTHX_ $_" : $_ } @nonnull; - $ret .= sprintf( "\n\t\t\t__attribute__((nonnull(%s)))", join( ",", @pos ) ); + if ($has_context) { + my @pos = map { $has_context ? $_ + 1 : $_ } @nonnull; + $ret .= sprintf( <