From: Alexey Tourbin Date: Sat, 19 Mar 2005 16:37:12 +0000 (+0300) Subject: Re: [perl #34493] h2ph `extern inline' problems X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf076876beb37faf404cb529462c0d3621da4786;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #34493] h2ph `extern inline' problems Message-ID: <20050319133712.GB6484@solemn.turbinal.org> and Message-ID: <20050319141457.GC6484@solemn.turbinal.org> p4raw-id: //depot/perl@24054 --- diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h index f13b69c..495789a 100644 --- a/t/lib/h2ph.h +++ b/t/lib/h2ph.h @@ -56,6 +56,11 @@ # define WHATEVER 1000 #endif +/* Test passing through the alien constructs (perlbug #34493) */ +#ifdef __LANGUAGE_PASCAL__ +function Tru64_Pascal(n: Integer): Integer; +#endif + /* * Test #include, #import and #include_next * #include_next is difficult to test, it really depends on the actual diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 8c574c3..6a5710b 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -403,7 +403,7 @@ sub expr { s/^\&\&// && do { $new .= " &&"; next;}; # handle && operator s/^\&([\(a-z\)]+)/$1/i; # hack for things that take the address of s/^(\s+)// && do {$new .= ' '; next;}; - s/^0X([0-9A-F]+)[UL]*//i + s/^0X([0-9A-F]+)[UL]*//i && do {my $hex = $1; $hex =~ s/^0+//; if (length $hex > 8 && !$Config{use64bitint}) { @@ -539,7 +539,7 @@ sub next_line while (length $in) { if ($pre_sub_tri_graphs) { - # Preprocess all tri-graphs + # Preprocess all tri-graphs # including things stuck in quoted string constants. $in =~ s/\?\?=/#/g; # | ??=| #| $in =~ s/\?\?\!/|/g; # | ??!| || @@ -552,17 +552,19 @@ sub next_line $in =~ s/\?\?>/}/g; # | ??>| }| } if ($in =~ /^\#ifdef __LANGUAGE_PASCAL__/) { - # Tru64 disassembler.h evilness: mixed C and Pascal. + # Tru64 disassembler.h evilness: mixed C and Pascal. while () { - last if /^\#endif/; + last if /^\#endif/; } + $in = ""; next READ; } if ($in =~ /^extern inline / && # Inlined assembler. $^O eq 'linux' && $file =~ m!(?:^|/)asm/[^/]+\.h$!) { - while () { - last if /^}/; + while () { + last if /^}/; } + $in = ""; next READ; } if ($in =~ s/\\$//) { # \-newline