From d1404acc69499e5158f2f85ee666836628372692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 23 Feb 2008 15:03:48 +0000 Subject: [PATCH] Handle c-comments. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22625 ec53bebd-3082-4978-b11e-865c3cabbd6b --- cf/make-proto.pl | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/cf/make-proto.pl b/cf/make-proto.pl index aac1fe2a9..ba7ec7026 100644 --- a/cf/make-proto.pl +++ b/cf/make-proto.pl @@ -4,11 +4,13 @@ ##use Getopt::Std; require 'getopts.pl'; -$brace = 0; -$line = ""; -$debug = 0; -$oproto = 1; -$private_func_re = "^_"; +my $comment = 0; +my $if_0 = 0; +my $brace = 0; +my $line = ""; +my $debug = 0; +my $oproto = 1; +my $private_func_re = "^_"; do Getopts('x:m:o:p:dqE:R:P:') || die "foo"; @@ -65,6 +67,14 @@ if($opt_x) { while(<>) { print $brace, " ", $_ if($debug); + + # Handle C comments + s@/\*.*\*/@@; + s@//.*/@@; + if ( s@/\*.*@@) { $comment = 1; + } elsif ($comment && s@.*\*/@@) { $comment = 0; + } elsif ($comment) { next; } + if(/^\#if 0/) { $if_0 = 1; }