#include "xregex.h"
#include "obstack.h"
#include "gengtype.h"
+#include "filenames.h"
/* Data types, macros, etc. used only in this file. */
lang_bitmap bitmap = get_lang_bitmap (gt_files[f]);
const char *basename = get_file_basename (gt_files[f]);
const char *slashpos = strchr (basename, '/');
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ const char *slashpos2 = strchr (basename, '\\');
+
+ if (!slashpos || (slashpos2 && slashpos2 < slashpos))
+ slashpos = slashpos2;
+#endif
if (slashpos)
{
static const char *
get_file_realbasename (const input_file *inpf)
{
- const char *f = get_input_file_name (inpf);
- const char *lastslash = strrchr (f, '/');
-
- return (lastslash != NULL) ? lastslash + 1 : f;
+ return lbasename (get_input_file_name (inpf));
}
/* For INPF a filename, return the relative path to INPF from
/* Look through to see if we've ever seen this output filename
before. If found, cache the result in inpf. */
for (r = output_files; r; r = r->next)
- if (strcmp (r->name, output_name) == 0)
+ if (filename_cmp (r->name, output_name) == 0)
{
inpf->inpoutf = r;
DBGPRINTF ("found r @ %p for output_name %s for_name %s", (void*)r,
const input_file *inpfx = (const input_file *) x;
const input_file *inpfy = (const input_file *) y;
gcc_assert (inpfx != NULL && inpfy != NULL);
- return !strcmp (get_input_file_name (inpfx), get_input_file_name (inpfy));
+ return !filename_cmp (get_input_file_name (inpfx), get_input_file_name (inpfy));
}