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]

(patch) 1/3 consolidate DIR_SEP/PATH_SEP macros in system.h


These macros are everywhere and really need to be consolidated. I'm
about to send a patch for protoize that adds yet another set of of
these otherwise.

2000-01-06  Mumit Khan  <khan@xraylith.wisc.edu>

	* cccp.c: Delete PATH_SEPARATOR, DIR_SEPARATOR and
	IS_DIR_SEPARATOR macros.
	* collect2.c: Likewise.
	* cppinit.c: Likewise.
	* dwarf2out.c: Likewise.
	* gcc.c: Likewise.
	* gcov.c: Likewise.
	* prefix.c: Likewise.
	* rtl.c: Likewise.
	* toplev.c: Likewise.
	* system.h: And move to here.

Index: gcc/cccp.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cccp.c,v
retrieving revision 1.90
diff -u -3 -p -r1.90 cccp.c
--- cccp.c	2000/01/05 06:55:02	1.90
+++ cccp.c	2000/01/06 02:19:39
@@ -46,16 +46,6 @@ typedef unsigned char U_CHAR;
 # define STANDARD_INCLUDE_DIR "/usr/include"
 #endif
 
-/* By default, colon separates directories in a path.  */
-#ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR ':'
-#endif
-
-/* By default, a slash separates directory names.  */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-#endif
-
 /* By default, the suffix for object files is ".o".  */
 #ifdef OBJECT_SUFFIX
 # define HAVE_OBJECT_SUFFIX
Index: gcc/collect2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/collect2.c,v
retrieving revision 1.87
diff -u -3 -p -r1.87 collect2.c
--- collect2.c	1999/11/25 16:58:31	1.87
+++ collect2.c	2000/01/06 02:19:39
@@ -49,18 +49,6 @@ Boston, MA 02111-1307, USA.  */
 #include "obstack.h"
 #include "intl.h"
 
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define IS_DIR_SEPARATOR(ch) ((ch) == '/')
-#else /* DIR_SEPARATOR */
-# ifndef DIR_SEPARATOR_2
-#  define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-# else /* DIR_SEPARATOR && DIR_SEPARATOR_2 */
-#  define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-# endif /* DIR_SEPARATOR && DIR_SEPARATOR_2 */
-#endif /* DIR_SEPARATOR */
-
 /* Obstack allocation and deallocation routines.  */
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
@@ -648,11 +636,6 @@ is_ctor_dtor (s)
   return 0;
 }
 
-/* By default, colon separates directories in a path.  */
-#ifndef PATH_SEPARATOR
-#define PATH_SEPARATOR ':'
-#endif
-
 /* We maintain two prefix lists: one from COMPILER_PATH environment variable
    and one from the PATH variable.  */
 
Index: gcc/cppinit.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cppinit.c,v
retrieving revision 1.28
diff -u -3 -p -r1.28 cppinit.c
--- cppinit.c	1999/12/19 04:43:20	1.28
+++ cppinit.c	2000/01/06 02:19:39
@@ -37,11 +37,6 @@ extern char *version_string;
 #define GET_ENV_PATH_LIST(VAR,NAME)	do { (VAR) = getenv (NAME); } while (0)
 #endif
 
-/* By default, colon separates directories in a path.  */
-#ifndef PATH_SEPARATOR
-#define PATH_SEPARATOR ':'
-#endif
-
 #ifndef STANDARD_INCLUDE_DIR
 #define STANDARD_INCLUDE_DIR "/usr/include"
 #endif
Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.137
diff -u -3 -p -r1.137 dwarf2out.c
--- dwarf2out.c	1999/12/30 05:58:56	1.137
+++ dwarf2out.c	2000/01/06 02:19:40
@@ -66,10 +66,6 @@ Boston, MA 02111-1307, USA.  */
 # define assert(e) do { if (! (e)) abort (); } while (0)
 #endif
 
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
 /* Decide whether we want to emit frame unwind information for the current
    translation unit.  */
 
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.123
diff -u -3 -p -r1.123 gcc.c
--- gcc.c	2000/01/04 16:29:39	1.123
+++ gcc.c	2000/01/06 02:19:40
@@ -65,15 +65,6 @@ extern int getrusage PROTO ((int, struct
 #define OBJECT_SUFFIX ".o"
 #endif
 
-/* By default, colon separates directories in a path.  */
-#ifndef PATH_SEPARATOR
-#define PATH_SEPARATOR ':'
-#endif
-
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
 #ifndef VMS
 /* FIXME: the location independence code for VMS is hairier than this,
    and hasn't been written.  */
@@ -81,14 +72,6 @@ extern int getrusage PROTO ((int, struct
 #define DIR_UP ".."
 #endif /* DIR_UP */
 #endif /* VMS */
-
-/* Define IS_DIR_SEPARATOR.  */
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
 
 static char dir_separator_str[] = {DIR_SEPARATOR, 0};
 
Index: gcc/gcov.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcov.c,v
retrieving revision 1.24
diff -u -3 -p -r1.24 gcov.c
--- gcov.c	1999/11/10 17:17:15	1.24
+++ gcov.c	2000/01/06 02:19:40
@@ -281,10 +281,6 @@ fnotice VPROTO ((FILE *file, const char 
   va_end (ap);
 }
 
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
 /* More 'friendly' abort that prints the line and file.
    config.h can #define abort fancy_abort if you like that sort of thing.  */
 extern void fancy_abort PROTO ((void)) ATTRIBUTE_NORETURN;
Index: gcc/prefix.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/prefix.c,v
retrieving revision 1.19
diff -u -3 -p -r1.19 prefix.c
--- prefix.c	1999/10/26 05:54:13	1.19
+++ prefix.c	2000/01/06 02:19:40
@@ -82,17 +82,6 @@ static char *lookup_key		PROTO((char *))
 static HKEY reg_key = (HKEY) INVALID_HANDLE_VALUE;
 #endif
 
-#ifndef DIR_SEPARATOR
-# define IS_DIR_SEPARATOR(ch) ((ch) == '/')
-#else /* DIR_SEPARATOR */
-# ifndef DIR_SEPARATOR_2
-#  define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-# else /* DIR_SEPARATOR && DIR_SEPARATOR_2 */
-#  define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-# endif /* DIR_SEPARATOR && DIR_SEPARATOR_2 */
-#endif /* DIR_SEPARATOR */
-
 /* Given KEY, as above, return its value.  */
 
 static const char *
@@ -330,7 +319,7 @@ update_path (path, key)
       do {
 	if (*new_path == '/')
 	  *new_path = DIR_SEPARATOR;
-      } while (*newpath++);
+      } while (*new_path++);
     }
 #endif
 
Index: gcc/rtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.c,v
retrieving revision 1.56
diff -u -3 -p -r1.56 rtl.c
--- rtl.c	1999/12/26 23:06:54	1.56
+++ rtl.c	2000/01/06 02:19:40
@@ -32,10 +32,6 @@ Boston, MA 02111-1307, USA.  */
 #define	obstack_chunk_alloc	xmalloc
 #define	obstack_chunk_free	free
 
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
 /* Obstack used for allocating RTL objects.
    Between functions, this is the permanent_obstack.
    While parsing and expanding a function, this is maybepermanent_obstack
Index: gcc/system.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/system.h,v
retrieving revision 1.56
diff -u -3 -p -r1.56 system.h
--- system.h	2000/01/04 08:10:30	1.56
+++ system.h	2000/01/06 02:19:40
@@ -528,6 +528,23 @@ extern void abort PARAMS ((void));
 # endif
 #endif /* ! HOST_PTR_PRINTF */
 
+/* By default, colon separates directories in a path.  */
+#ifndef PATH_SEPARATOR
+#define PATH_SEPARATOR ':'
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+/* Define IS_DIR_SEPARATOR.  */
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
 /* Get libiberty declarations. */
 #include "libiberty.h"
 
Index: gcc/toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.275
diff -u -3 -p -r1.275 toplev.c
--- toplev.c	2000/01/05 06:55:02	1.275
+++ toplev.c	2000/01/06 02:19:42
@@ -137,10 +137,6 @@ You Lose!  You must define PREFERRED_DEB
 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
 #endif
 
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
 #if ! (defined (VMS) || defined (OS2))
 extern char **environ;
 #endif


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