summaryrefslogtreecommitdiffstats
path: root/gcc/system.h
diff options
context:
space:
mode:
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"
OpenPOWER on IntegriCloud