FreeBSD/contrib/gcc/c-incpath.c
/* Add PATH to the include chain CHAIN. PATH must be malloc-ed and
   NUL-terminated.  */
Add PATH to the include chain CHAIN. PATH must be malloc-ed and
NUL-terminated.
Add PATH to the include chain CHAIN . PATH must be malloc - ed and NUL - terminated .
void
add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
{
  cpp_dir *p;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  char* c;
  for (c = path; *c; c++)
    if (*c == '\\') *c = '/';
#endif
  p = XNEW (cpp_dir);
  p->next = NULL;
  p->name = path;
  if (chain == SYSTEM || chain == AFTER)
    p->sysp = 1 + !cxx_aware;
  else
    p->sysp = 0;
  p->construct = 0;
  p->user_supplied_p = user_supplied_p;
  add_cpp_dir_path (p, chain);
}
void add_path ( char * path , int chain , int cxx_aware , bool user_supplied_p ) { cpp_dir * p ; #if defined ( HAVE_DOS_BASED_FILE_SYSTEM ) char * c ; for ( c = path ; * c ; c ++ ) if ( * c == ' \\ ' ) * c = ' ' ; #endif p = XNEW ( cpp_dir ) ; p -> next = NULL ; p -> name = path ; if ( chain == SYSTEM || chain == AFTER ) p -> sysp = 1 + ! cxx_aware ; else p -> sysp = 0 ; p -> construct = 0 ; p -> user_supplied_p = user_supplied_p ; add_cpp_dir_path ( p , chain ) ; }
Add PATH to the include chain CHAIN.
Add PATH to the include chain CHAIN .
/* Convert all backslashes to slashes.  The native CRT stat()
     function does not recognize a directory that ends in a backslash
     (unless it is a drive root dir, such "c:\").  Forward slashes,
     trailing or otherwise, cause no problems for stat().  */