X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=embed.pl;h=27815ae9cd75804aa01c91e2eac0c9dc73c0022d;hb=2522aa67345a7f37d0050d70f341ab3a0b6165b0;hp=9cdef0782ae0dc481afca131fd00d06727c28f37;hpb=f54cb97a39f1a5849851e77a33524dfca2644cf5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/embed.pl b/embed.pl index 9cdef07..27815ae 100755 --- a/embed.pl +++ b/embed.pl @@ -24,6 +24,7 @@ sub do_not_edit ($) $years =~ s/1999,/1999,\n / if length $years > 40; my $warning = <$filename" or die "Can't open $filename: $!"; binmode F; $F = \*F; @@ -120,7 +121,7 @@ sub munge_c_files () { if (@_ > 1) { $functions->{$_[2]} = \@_ if $_[@_-1] =~ /\.\.\./; } - } '/dev/null', ''; + } '/dev/null', '', ''; local $^I = '.bak'; while (<>) { # if (/^#\s*include\s+"perl.h"/) { @@ -203,17 +204,17 @@ sub write_protos { $ret .= ")"; my @attrs; if ( $flags =~ /r/ ) { - push @attrs, "__attribute__((noreturn))"; + push @attrs, "__attribute__noreturn__"; } if ( $flags =~ /a/ ) { - push @attrs, "__attribute__((malloc))"; + push @attrs, "__attribute__malloc__"; $flags .= "R"; # All allocing must check return value } if ( $flags =~ /R/ ) { - push @attrs, "__attribute__((warn_unused_result))"; + push @attrs, "__attribute__warn_unused_result__"; } if ( $flags =~ /P/ ) { - push @attrs, "__attribute__((pure))"; + push @attrs, "__attribute__pure__"; } if( $flags =~ /f/ ) { my $prefix = $has_context ? 'pTHX_' : ''; @@ -223,7 +224,7 @@ sub write_protos { } if ( @nonnull ) { my @pos = map { $has_context ? "pTHX_$_" : $_ } @nonnull; - push @attrs, sprintf( "__attribute__((nonnull(%s)))", join( ",", @pos ) ); + push @attrs, map { sprintf( "__attribute__nonnull__(%s)", $_ ) } @pos; } if ( @attrs ) { $ret .= "\n"; @@ -250,8 +251,8 @@ sub write_global_sym { $ret; } -walk_table(\&write_protos, "proto.h", undef); -walk_table(\&write_global_sym, "global.sym", undef); +walk_table(\&write_protos, "proto.h", undef, "/* ex: set ro: */\n"); +walk_table(\&write_global_sym, "global.sym", undef, "# ex: set ro:\n"); # XXX others that may need adding # warnhook @@ -601,6 +602,7 @@ print EM <<'END'; # define Perl_sv_setpvf_mg_nocontext Perl_sv_setpvf_mg #endif +/* ex: set ro: */ END close(EM) or die "Error closing EM: $!"; @@ -710,6 +712,8 @@ for $sym (sort @extvars) { print EM <<'END'; #endif /* PERL_POLLUTE */ + +/* ex: set ro: */ END close(EM) or die "Error closing EM: $!"; @@ -790,10 +794,27 @@ EXTCONST void * const PL_force_link_funcs[] = { #define PERLVARIC(v,t,i) PERLVAR(v,t) #define PERLVARISC(v,i) PERLVAR(v,char) +/* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one + * cannot cast between void pointers and function pointers without + * info level warnings. The PL_force_link_funcs[] would cause a few + * hundred of those warnings. In code one can circumnavigate this by using + * unions that overlay the different pointers, but in declarations one + * cannot use this trick. Therefore we just disable the warning here + * for the duration of the PL_force_link_funcs[] declaration. */ + +#if defined(__DECC) && defined(__osf__) +#pragma message save +#pragma message disable (nonstandcast) +#endif + #include "thrdvar.h" #include "intrpvar.h" #include "perlvars.h" +#if defined(__DECC) && defined(__osf__) +#pragma message restore +#endif + #undef PERLVAR #undef PERLVARA #undef PERLVARI @@ -829,6 +850,7 @@ print CAPIH <<'EOT'; #endif /* __perlapi_h__ */ +/* ex: set ro: */ EOT close CAPIH or die "Error closing CAPIH: $!"; @@ -905,6 +927,8 @@ unsigned char** Perl_Gfold_locale_ptr(pTHX) { END_EXTERN_C #endif /* MULTIPLICITY */ + +/* ex: set ro: */ EOT close(CAPI) or die "Error closing CAPI: $!";