[comp.lang.perl] [MAILER-DAEMON@ATHENA.MIT.EDU

marc@athena.mit.edu (09/17/90)

The .ph files generated by h2ph don't do the right thing with
#include directives.  If a file includes <sys/types.h>, the .ph file
should try to do 'sys/types.ph', not 'sys/types.h'.  This UNOFFICIAL
patch fixes it:

*** h2ph.SH.pl28        Fri Sep 14 17:49:38 1990
---- h2ph.SH     Fri Sep 14 18:13:49 1990
***************
*** 102,108 ****
                }
            }
            elsif (/^include <(.*)>/) {
!               print OUT $t,"do '$1' || die \"Can't include $1: \$!\";\n";
            }
            elsif (/^ifdef\s+(\w+)/) {
                print OUT $t,"if (defined &$1) {\n";
---- 102,109 ----
                }
            }
            elsif (/^include <(.*)>/) {
!               ($file = $1) =~ s/\.h$/.ph/;
!               print OUT $t,"do '$file' || die \"Can't include $file: \$!\";\n";
            }
            elsif (/^ifdef\s+(\w+)/) {
                print OUT $t,"if (defined &$1) {\n";
***************
*** 210,221 ****
  .I h2ph
  converts any C header files specified to the corresponding Perl header file
  format.
-- It is most easily run while in /usr/include:
-- .nf
--
--       cd /usr/include; h2ph * sys/*
--
-- .fi
  .SH ENVIRONMENT
  No environment variables are used.
  .SH FILES
---- 211,216 ----

The second hunk of the patch deletes some irrelevant text from the man
page.  It recommends that you cd /usr/include, while the perl script
does this for you anyway.

		Marc

------- End of Forwarded Message