From: pavenis AT lanet DOT lv To: Eli Zaretskii , djgpp-workers AT delorie DOT com Date: Mon, 19 Mar 2001 16:27:47 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: About release of gcc-2.95.3 for DJGPP Cc: Hans-Bernhard Broeker Message-ID: <3AB63383.27090.141E220@localhost> References: <3AB61398 DOT 19432 DOT C52D4E AT localhost> In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.12c) Reply-To: djgpp-workers AT delorie DOT com On 19 Mar 2001, at 15:44, Eli Zaretskii wrote: > > On Mon, 19 Mar 2001 pavenis AT lanet DOT lv wrote: > > > > > gcov generates name of output file by appending to name ".gcov". > > > > So for foo.c we're getting foo.c.gcov. > > > > > > Making foo.gcov would probably solve this. > > > > Perhaps not so. foo.c and foo.h may both contain code (the second - > > some inline functions) > > Right. Then it has to be something more complicated, like this: > > foo.c -> foo.cgcov > foo.h -> foo.hgcov > foo.cc -> foo.ccgcov > foo.cpp -> foo.cpgcov > > That is, leave at least the leading `g' of `gcov' in the extension, > eating up the original extension as needed. Seems that following will do that (when LFN is not available). Does it seem acceptable? Andris --- gcov.c~1 Mon Mar 19 15:55:38 2001 +++ gcov.c Mon Mar 19 16:18:14 2001 @@ -1284,6 +1284,23 @@ the same basename, e.g. tmp.c and tmp.h. */ strcat (gcov_file_name, ".gcov"); +#ifdef __DJGPP__ + if (!_use_lfn(gcov_file_name)) + { + char *s1, *s2=NULL; + for (s1=gcov_file_name; *s1 && *s1!='.'; s1++); + if (*s1) for (s2=s1+1; *s2 && *s2!='.'; s2++); + if (s2 && *s2=='.') + { + int l; + s1++; l=s2-s1; if (l>2) l=2; + s1 = s1+l; s2++; + while (*s2) { *s1++=*s2++; } + *s1=0; + } + } +#endif + gcov_file = fopen (gcov_file_name, "w"); if (gcov_file == NULL)