summaryrefslogtreecommitdiff
path: root/odb/include.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-27 17:24:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-27 17:24:57 +0200
commit34286111363ca14aae81d50ab16732627425ef72 (patch)
tree5862221a980e92162380afa4fe31b86efdc5b54d /odb/include.cxx
parent52793dc8860e38f725dc0ca8300c4e2ca9d4ceb9 (diff)
GCC 4.7 compatibility changes
Diffstat (limited to 'odb/include.cxx')
-rw-r--r--odb/include.cxx29
1 files changed, 25 insertions, 4 deletions
diff --git a/odb/include.cxx b/odb/include.cxx
index 7168b01..0cfe0ce 100644
--- a/odb/include.cxx
+++ b/odb/include.cxx
@@ -487,23 +487,36 @@ namespace include
// Add all the known include locations for each file in the map.
//
- for (size_t i (0); i < line_table->used; ++i)
+#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
+ size_t used (line_table->used);
+ line_map const* maps (line_table->maps);
+#else
+ size_t used (line_table->info_ordinary.used);
+ line_map const* maps (line_table->info_ordinary.maps);
+#endif
+
+ for (size_t i (0); i < used; ++i)
{
- line_map const* m (line_table->maps + i);
+ line_map const* m (maps + i);
if (MAIN_FILE_P (m) || m->reason != LC_ENTER)
continue;
- line_map const* i (INCLUDED_FROM (line_table, m));
+ line_map const* ifm (INCLUDED_FROM (line_table, m));
+#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
path f (m->to_file);
+#else
+ path f (ORDINARY_MAP_FILE_NAME (m));
+#endif
+
f.complete ();
f.normalize ();
include_map::iterator it (imap.find (f));
if (it != imap.end ())
- it->second[i] = include_directive ();
+ it->second[ifm] = include_directive ();
}
//
@@ -549,7 +562,11 @@ namespace include
if (main_lm != 0)
{
+#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
string f (main_lm->to_file);
+#else
+ string f (ORDINARY_MAP_FILE_NAME (main_lm));
+#endif
size_t n (f.size ());
// Check if this is a synthesized fragment.
@@ -573,7 +590,11 @@ namespace include
{
line_map const* lm (j->first);
+#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
string f (lm->to_file);
+#else
+ string f (ORDINARY_MAP_FILE_NAME (lm));
+#endif
size_t n (f.size ());
// Check if this is a synthesized fragment.