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]
Other format: [Raw text]

RFA: Use filenames.h in libiberty/lbasename.c


The separate copy of IS_DIR_SEPARATOR in lbasename.c has gotten out of date;
it was pointed out that it should check __CYGWIN__ like the one in
filenames.h.  So just use that copy.

There's only two reasons this patch might not be obvious:
  - filenames.h claims to be part of BFD even though it's in both
    repositories.
  - lbasename.c (based on code copied out of GCC at some point) checks
    __DJGPP__ and filenames.h doesn't.

I'm pretty sure that neither of those is a real problem.  OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-12-22  Daniel Jacobowitz  <drow@mvista.com>

	PR debug/13272
	* Makefile.in (lbasename.o): Depend on filenames.h.
	* lbasename.c: Include "filenames.h" instead of defining
	its macros locally.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/Makefile.in,v
retrieving revision 1.94
diff -u -p -r1.94 Makefile.in
--- Makefile.in	15 Dec 2003 19:00:49 -0000	1.94
+++ Makefile.in	22 Dec 2003 18:06:58 -0000
@@ -451,7 +451,7 @@ hashtab.o: config.h $(INCDIR)/ansidecl.h
 hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
 	$(INCDIR)/safe-ctype.h
 lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
-	$(INCDIR)/safe-ctype.h
+	$(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h
 lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
 make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \
 	$(INCDIR)/libiberty.h
Index: lbasename.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/lbasename.c,v
retrieving revision 1.4
diff -u -p -r1.4 lbasename.c
--- lbasename.c	18 Jun 2002 02:04:33 -0000	1.4
+++ lbasename.c	22 Dec 2003 18:06:58 -0000
@@ -40,25 +40,7 @@ and a path ending in @code{/} returns th
 #include "ansidecl.h"
 #include "libiberty.h"
 #include "safe-ctype.h"
-
-#ifndef DIR_SEPARATOR
-#  define DIR_SEPARATOR '/'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) \
-    || defined (__DJGPP__) || defined (__OS2__)
-#  define HAVE_DOS_BASED_FILE_SYSTEM
-#  ifndef DIR_SEPARATOR_2 
-#    define DIR_SEPARATOR_2 '\\'
-#  endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-#  define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else
-#  define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif
+#include "filenames.h"
 
 const char *
 lbasename (name)


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