From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,dcc787a7dc2bc291 X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,dcc787a7dc2bc291 X-Google-Attributes: gidfee84,public From: ccam@spiral2.its.latrobe.edu.au (Andrew Moar) Subject: Re: PGP 5.0i compile problem - LOCATED Date: 1999/01/20 Message-ID: <783k9b$d73$1@news.latrobe.edu.au>#1/1 X-Deja-AN: 434710396 References: <36A4749D.37F4F8D4@ev.co.yu> Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.latrobe.edu.au X-Trace: news.latrobe.edu.au 916804715 13539 131.172.12.60 (20 Jan 1999 03:58:35 GMT) Organization: La Trobe University Mime-Version: 1.0 NNTP-Posting-Date: 20 Jan 1999 03:58:35 GMT Newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc In article <36A4749D.37F4F8D4@ev.co.yu>, Nikola Milutinovic writes: [ -snip- ] > PROBLEM > ------- > Several lines containing conditional pre-processor directives "#if", > "#ifdef", "#ifndef" and "#endif" were not placed in the 1st column of > the line, they were in. In other words, they were indented. This caused > cpp to drop them from compiling, causing "a lot of fun" for the cc. I've seen similar problems in other freeware source code and have used the following perl script to fix it. #!/usr/local/bin/perl $file = @ARGV[0]; $filetmp = "$file.xxx"; open(OUTFILE, ">$filetmp") || die "$0: can't open $filetmp\n"; select(OUTFILE); #printf "%s\n", $file; while (<>) { $a = $_; if ($a =~ /#/) { $a =~ s/^ +//; $a =~ s/^\t+//; } print $a; } rename($filetmp,$file); (perl isn't my strongest language so it's probably a pretty average script. Looking back at it, I'm not even sure how it works!) You could then run it something like: find . -exec fixdefines.pl {} \; under the source code directory. Cheers -- Andrew Moar : Ph +61 3 9479 1505 email A.Moar@latrobe.edu.au Unix Environment Manager, Information Technology Services La Trobe University, Melbourne