/* Set up combined include path chain for the preprocessor.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
Free Software Foundation, Inc.
Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003.
#define DIRS_EQ(A, B) ((A)->dev == (B)->dev \
&& INO_T_EQ((A)->ino, (B)->ino))
#else
-#define DIRS_EQ(A, B) (!strcmp ((A)->canonical_name, (B)->canonical_name))
+#define DIRS_EQ(A, B) (!filename_cmp ((A)->canonical_name, (B)->canonical_name))
#endif
static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
{
char *p, *q, *path;
- GET_ENVIRONMENT (q, env_var);
+ q = getenv (env_var);
if (!q)
return;
now. */
if (sysroot && p->add_sysroot)
continue;
- if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
+ if (!filename_ncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
{
char *str = concat (iprefix, p->fname + len, NULL);
if (p->multilib && imultilib)
if (sysroot && p->add_sysroot)
str = concat (sysroot, p->fname, NULL);
else if (!p->add_sysroot && relocated
- && strncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len) == 0)
+ && !filename_ncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len))
{
static const char *relocated_prefix;
/* If this path starts with the configure-time prefix,
}
}
else if (!S_ISDIR (st.st_mode))
- cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0,
+ cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0,
"%s: not a directory", cur->name);
else
{
void
split_quote_chain (void)
{
+ if (heads[QUOTE])
+ free_path (heads[QUOTE], REASON_QUIET);
+ if (tails[QUOTE])
+ free_path (tails[QUOTE], REASON_QUIET);
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
heads[BRACKET] = NULL;
cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET],
quote_ignores_source_dir);
}
+
+/* Return the current chain of cpp dirs. */
+
+struct cpp_dir *
+get_added_cpp_dirs (int chain)
+{
+ return heads[chain];
+}
+
#if !(defined TARGET_EXTRA_INCLUDES) || !(defined TARGET_EXTRA_PRE_INCLUDES)
static void hook_void_charptr_charptr_int (const char *sysroot ATTRIBUTE_UNUSED,
const char *iprefix ATTRIBUTE_UNUSED,