This is the mail archive of the
mailing list for the GCC project.
Re: Disabling top level fixincludes
Bruce Korb wrote:
> "Aaron W. LaFramboise" wrote:
>>Bruce Korb wrote:
>>Attached is a revised patch.
>>Once this is applied, and PR17991 is resolved, fixincludes will build on
> Excellent. Thanks. - Bruce
Now that two-process fixincludes is fixed and builds, I see that I
missed one Windows-compatibility bit: Windows doesn't have pathconf().
The logic in the code that uses pathconf() does not actually seem
related to filename truncation, as the comments suggest, but rather
detecting the case where more than one dot in a filename is not allowed.
I suspect that this code only works for DJGPP, and it isn't needed on
Windows anyway, so I think its best just to disable it if pathconf()
By the way, while I have a copyright assignment, I don't have CVS
access, so if you or someone else could commit these two patches for me,
I would be grateful.
Aaron W. LaFramboise
2004-10-19 Aaron W. LaFramboise <email@example.com>
* fixfixes.c (main): Check for _PC_NAME_MAX.
RCS file: /cvsroot/gcc/gcc/fixincludes/fixfixes.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 fixfixes.c
*** gcc/fixincludes/fixfixes.c 15 Oct 2004 07:58:38 -0000 1.2
--- gcc/fixincludes/fixfixes.c 19 Oct 2004 19:26:37 -0000
*************** main( int argc, char** argv )
*** 778,787 ****
--- 778,789 ----
doesn't allow more than one dot in the trunk of a file name. */
pz_tmp_base = basename( pz_tmptmp );
pz_tmp_dot = strchr( pz_tmp_base, '.' );
+ #ifdef _PC_NAME_MAX
if (pathconf( pz_tmptmp, _PC_NAME_MAX ) <= 12 /* is this DOS or Windows9X? */
&& pz_tmp_dot != (char*)NULL)
strcpy (pz_tmp_dot+1, "X"); /* nuke the original extension */
+ #endif /* _PC_NAME_MAX */
strcat (pz_tmptmp, ".X");
if (freopen (pz_tmptmp, "w", stdout) != stdout)