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


This is what mkdeps.c used to use, before I pushed for use to use basename
instead (we dropped VMS support since no-one was prepared to fix the bit
rot at the time):

static const char *
base_name (fname)
     const char *fname;
{
  const char *s = fname;
  const char *p;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  if (ISALPHA (s[0]) && s[1] == ':') s += 2;
  if ((p = strrchr (s, '\\'))) s = p + 1;
#elif defined VMS
  if ((p = strrchr (s, ':'))) s = p + 1; /* Skip device.  */
  if ((p = strrchr (s, ']'))) s = p + 1; /* Skip directory.  */
  if ((p = strrchr (s, '>'))) s = p + 1; /* Skip alternate (int'n'l) dir.  */
#endif
  if ((p = strrchr (s, '/'))) s = p + 1;
  return s;
}

This may or may not be useful; it would be great to have a common routine
getting this right for all targets.

Neil.

John David Anglin wrote:-

> I guess it could if we introduce a DRIVE_SEPARATOR or a third
> directory separator.  DOS type systems effectively have three: '\',
> '/' and ':'.
> 
> I wonder why alpha VMS ignores '>' and ':'.  I can guess that '>' is
> used infrequently.  I am told there is no difference between file
> name conventions on the alpha and vax.
> 
> I also just noticed the VMS FILE_NAME_NONDIRECTORY translates the name to
> lower case.  Thus, it now looks like we need to keep file_name_nondirectory
> because it is functionally different from basename under vax VMS.  Does
> the alpha port need to define FILE_NAME_NONDIRECTORY?
> 
> The argument to file_name_nondirectory shouldn't be const.  The protos
> need to change.
> 
> The PATH_SEPARATOR should be ',' for VMS.  This isn't defined for either
> the alpha or vax.


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