Re: [perl #34493] h2ph `extern inline' problems
Alexey Tourbin [Sat, 19 Mar 2005 16:37:12 +0000 (19:37 +0300)]
Message-ID: <20050319133712.GB6484@solemn.turbinal.org>

and

Message-ID: <20050319141457.GC6484@solemn.turbinal.org>

p4raw-id: //depot/perl@24054

t/lib/h2ph.h
utils/h2ph.PL

index f13b69c..495789a 100644 (file)
 #    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
index 8c574c3..6a5710b 100644 (file)
@@ -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 (<IN>) {
-                   last if /^\#endif/; 
+                   last if /^\#endif/;
                }
+               $in = "";
                next READ;
            }
            if ($in =~ /^extern inline / && # Inlined assembler.
                $^O eq 'linux' && $file =~ m!(?:^|/)asm/[^/]+\.h$!) {
-               while (<IN>) {
-                   last if /^}/; 
+               while (<IN>) {
+                   last if /^}/;
                }
+               $in = "";
                next READ;
            }
             if ($in =~ s/\\$//) {                           # \-newline