2011-03-23 Kai Tietz <ktietz@redhat.com>
[deliverable/binutils-gdb.git] / gdb / macrotab.c
index 3bf7a56fd416c1336d049b388456b195a3def218..cba285dc9dc7174bb7866d9cad585e60bc909dd4 100644 (file)
@@ -21,6 +21,7 @@
 #include "defs.h"
 #include "gdb_obstack.h"
 #include "splay-tree.h"
+#include "filenames.h"
 #include "symtab.h"
 #include "symfile.h"
 #include "objfiles.h"
@@ -160,7 +161,7 @@ struct macro_key
   struct macro_table *table;
 
   /* The name of the macro.  This is in the table's bcache, if it has
-     one. */
+     one.  */
   const char *name;
 
   /* The source file and line number where the definition's scope
@@ -470,8 +471,8 @@ macro_include (struct macro_source_file *source,
 
          First, squawk.  */
       complaint (&symfile_complaints,
-                _("both `%s' and `%s' allegedly #included at %s:%d"), included,
-                (*link)->filename, source->filename, line);
+                _("both `%s' and `%s' allegedly #included at %s:%d"),
+                included, (*link)->filename, source->filename, line);
 
       /* Now, choose a new, unoccupied line number for this
          #inclusion, after the alleged #inclusion line.  */
@@ -500,7 +501,7 @@ struct macro_source_file *
 macro_lookup_inclusion (struct macro_source_file *source, const char *name)
 {
   /* Is SOURCE itself named NAME?  */
-  if (strcmp (name, source->filename) == 0)
+  if (filename_cmp (name, source->filename) == 0)
     return source;
 
   /* The filename in the source structure is probably a full path, but
@@ -510,11 +511,12 @@ macro_lookup_inclusion (struct macro_source_file *source, const char *name)
     int src_name_len = strlen (source->filename);
 
     /* We do mean < here, and not <=; if the lengths are the same,
-       then the strcmp above should have triggered, and we need to
+       then the filename_cmp above should have triggered, and we need to
        check for a slash here.  */
     if (name_len < src_name_len
-        && source->filename[src_name_len - name_len - 1] == '/'
-        && strcmp (name, source->filename + src_name_len - name_len) == 0)
+        && IS_DIR_SEPARATOR (source->filename[src_name_len - name_len - 1])
+        && filename_cmp (name,
+                        source->filename + src_name_len - name_len) == 0)
       return source;
   }
 
@@ -729,7 +731,8 @@ check_for_redefinition (struct macro_source_file *source, int line,
       if (! same)
         {
          complaint (&symfile_complaints,
-                    _("macro `%s' redefined at %s:%d; original definition at %s:%d"),
+                    _("macro `%s' redefined at %s:%d; "
+                      "original definition at %s:%d"),
                     name, source->filename, line,
                     found_key->start_file->filename, found_key->start_line);
         }
This page took 0.024835 seconds and 4 git commands to generate.