This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: VAX PATCH: remove FILE_NAME_NONDIRECTORY


> > The VMS port overrode the define for this macro because it needed
> > special handling to extract a file name.  The current version of
> > file_name_nondirectory in toplev.c is not appropriate for VMS.
> > 
> > Thus, we need instead to redefine the macro and change all calls to
> > file_name_nondirectory to fix the problem.
> 
> Wouldn't it be better to make file_name_nondirectory honor the macro?
> Then we only have to worry about it in one place.

This should fix the problem. OK?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-02-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* toplev.c (file_name_nondirectory): Use FILE_NAME_NONDIRECTORY
	macro if defined.

--- toplev.c.orig	Fri Feb 16 17:17:37 2001
+++ toplev.c	Wed Feb 21 15:27:56 2001
@@ -1731,6 +1731,9 @@
 file_name_nondirectory (x)
      const char *x;
 {
+#ifdef FILE_NAME_NONDIRECTORY
+  return FILE_NAME_NONDIRECTORY (x);
+#else
   char *tmp = (char *) strrchr (x, '/');
   if (DIR_SEPARATOR != '/' && ! tmp)
     tmp = (char *) strrchr (x, DIR_SEPARATOR);
@@ -1738,6 +1741,7 @@
     return (char *) (tmp + 1);
   else
     return (char *) x;
+#endif
 }
 
 /* Output a quoted string.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]