summaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-28 14:58:08 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-28 14:58:08 +0000
commit7d3bd8c09e25f815213b50e8869134d7d52de2cc (patch)
tree5f103e128799a70a1832432704583e13f433de18 /gcc/system.h
parent46a79a8f352c4eddd7166b3e0c5700376b8b8b86 (diff)
downloadgcc-7d3bd8c09e25f815213b50e8869134d7d52de2cc.tar.gz
* system.h (IS_DIR_SEPARATOR): Use uppercase macro name.
(IS_ABSOLUTE_PATHNAME): New macro. * gcc.c (find_a_file, process_command, do_spec_1, main): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/system.h b/gcc/system.h
index 20531ddb4e5..59caf48f0e5 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -538,12 +538,25 @@ extern void abort PARAMS ((void));
/* Define IS_DIR_SEPARATOR. */
#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+# define IS_DIR_SEPARATOR(CH) ((CH) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+# define IS_DIR_SEPARATOR(CH) \
+ (((CH) == DIR_SEPARATOR) || ((CH) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */
+/* Say how to test for an absolute pathname. On Unix systems, this is if
+ it starts with a leading slash or a '$', the latter meaning the value of
+ an environment variable is to be used. On machien with DOS-based
+ file systems, it is also absolute if it starts with a drive identifier. */
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+#define IS_ABSOLUTE_PATHNAME(STR) \
+ (IS_DIR_SEPARATOR ((STR)[0]) || (STR)[0] == '$' \
+ || ((STR)[0] != '\0' && (STR)[1] == ':' && IS_DIR_SEPARATOR ((STR)[2])))
+#else
+#define IS_ABSOLUTE_PATHNAME(STR) \
+ (IS_DIR_SEPARATOR ((STR)[0]) || (STR)[0] == '$')
+#endif
+
/* Get libiberty declarations. */
#include "libiberty.h"