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]

Re: CPP tweaks for dos/win32 v2


I should trash this mail program, because all it does is cause me grief. It turned tabs 
into spaces in my last message. One last time...

2000-01-11  Mark Elbrecht  <snowball3@bigfoot.com>

	* cppfiles.c (cpp_included, find_include_file, _cpp_execute_include)
	  (read_name_map): Use IS_ABSOLUTE_PATH.
	* tradcpp.c (get_filename): Likewise.

Index: gcc/gcc/cppfiles.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppfiles.c,v
retrieving revision 1.98
diff -c -p -r1.98 cppfiles.c
*** cppfiles.c	2001/01/09 10:43:47	1.98
--- cppfiles.c	2001/01/11 17:19:31
*************** cpp_included (pfile, fname)
*** 430,436 ****
    char *name;
    splay_tree_node nd;
  
!   if (fname[0] == '/')
      {
        /* Just look it up.  */
        nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
--- 430,436 ----
    char *name;
    splay_tree_node nd;
  
!   if (IS_ABSOLUTE_PATHNAME (fname))
      {
        /* Just look it up.  */
        nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
*************** find_include_file (pfile, fname, search_
*** 470,476 ****
    char *name;
    struct include_file *file;
  
!   if (fname[0] == '/')
      return open_file (pfile, fname);
        
    /* Search directory path for the file.  */
--- 470,476 ----
    char *name;
    struct include_file *file;
  
!   if (IS_ABSOLUTE_PATHNAME (fname))
      return open_file (pfile, fname);
        
    /* Search directory path for the file.  */
*************** _cpp_execute_include (pfile, header, no_
*** 648,654 ****
    if (CPP_OPTION (pfile, print_deps_missing_files)
        && PRINT_THIS_DEP (pfile, angle_brackets))
      {
!       if (!angle_brackets || *fname == '/')
  	deps_add_dep (pfile->deps, fname);
        else
  	{
--- 648,654 ----
    if (CPP_OPTION (pfile, print_deps_missing_files)
        && PRINT_THIS_DEP (pfile, angle_brackets))
      {
!       if (!angle_brackets || IS_ABSOLUTE_PATHNAME (fname))
  	deps_add_dep (pfile->deps, fname);
        else
  	{
*************** read_name_map (pfile, dirname)
*** 890,896 ****
  	  ptr->map_from = from;
  
  	  /* Make the real filename absolute.  */
! 	  if (*to == '/')
  	    ptr->map_to = to;
  	  else
  	    {
--- 890,896 ----
  	  ptr->map_from = from;
  
  	  /* Make the real filename absolute.  */
! 	  if (IS_ABSOLUTE_PATHNAME (to))
  	    ptr->map_to = to;
  	  else
  	    {
Index: gcc/gcc/tradcpp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tradcpp.c,v
retrieving revision 1.30
diff -c -p -r1.30 tradcpp.c
*** tradcpp.c	2001/01/10 23:28:00	1.30
--- tradcpp.c	2001/01/11 17:20:08
*************** get_filename:
*** 2374,2380 ****
  
    /* If specified file name is absolute, just open it.  */
  
!   if (*fbeg == '/') {
      strncpy (fname, (const char *)fbeg, flen);
      fname[flen] = 0;
      f = open (fname, O_RDONLY, 0666);
--- 2374,2380 ----
  
    /* If specified file name is absolute, just open it.  */
  
!   if (IS_ABSOLUTE_PATHNAME (fbeg)) {
      strncpy (fname, (const char *)fbeg, flen);
      fname[flen] = 0;
      f = open (fname, O_RDONLY, 0666);
*************** get_filename:
*** 2409,2415 ****
        else
  	stackp = include;
  
!       if (!system_header_p || *fbeg == '/' || !stackp->fname)
  	deps_add_dep (deps, fname);
        else {
  	char *p;
--- 2409,2415 ----
        else
  	stackp = include;
  
!       if (!system_header_p || IS_ABSOLUTE_PATH (fbeg) || !stackp->fname)
  	deps_add_dep (deps, fname);
        else {
  	char *p;


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