summaryrefslogtreecommitdiff
path: root/odb/include.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-05 16:01:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-05 16:01:42 +0200
commit511dcf67322ad87fb32f97d1cf7725c129e83898 (patch)
treecfcbf8705fc208d101b8adbd270a425e7466d518 /odb/include.cxx
parentd1b34452618d36eb486ff18b16f5d94acc6eeb07 (diff)
Initial work to make ODB compatible with GCC 6
Diffstat (limited to 'odb/include.cxx')
-rw-r--r--odb/include.cxx31
1 files changed, 21 insertions, 10 deletions
diff --git a/odb/include.cxx b/odb/include.cxx
index 9c03f99..32d50a6 100644
--- a/odb/include.cxx
+++ b/odb/include.cxx
@@ -30,9 +30,18 @@ namespace
path path_;
};
+#if BUILDING_GCC_MAJOR >= 6
+ typedef line_map_ordinary line_map_type;
+#else
+ typedef line_map line_map_type;
+# ifndef linemap_check_ordinary
+# define linemap_check_ordinary(X) (X)
+# endif
+#endif
+
struct includes
{
- typedef std::map<line_map const*, include_directive> map_type;
+ typedef std::map<line_map_type const*, include_directive> map_type;
bool trailing; // Included at the beginning or at the end of the main file.
map_type map;
};
@@ -146,7 +155,9 @@ namespace
//
if (l > BUILTINS_LOCATION)
{
- line_map const* lm (linemap_lookup (line_table, l));
+ line_map_type const* lm (
+ linemap_check_ordinary (
+ linemap_lookup (line_table, l)));
if (lm != 0 && !MAIN_FILE_P (lm))
{
@@ -539,20 +550,20 @@ namespace
//
#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
size_t used (line_table->used);
- line_map const* maps (line_table->maps);
+ line_map_type const* maps (line_table->maps);
#else
size_t used (line_table->info_ordinary.used);
- line_map const* maps (line_table->info_ordinary.maps);
+ line_map_type const* maps (line_table->info_ordinary.maps);
#endif
for (size_t i (0); i < used; ++i)
{
- line_map const* m (maps + i);
+ line_map_type const* m (maps + i);
if (MAIN_FILE_P (m) || m->reason != LC_ENTER)
continue;
- line_map const* ifm (INCLUDED_FROM (line_table, m));
+ line_map_type const* ifm (INCLUDED_FROM (line_table, m));
#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
path f (m->to_file);
@@ -582,7 +593,7 @@ namespace
for (includes::iterator j (i->second.begin ());
j != i->second.end (); ++j)
{
- line_map const* lm (j->first);
+ line_map_type const* lm (j->first);
cerr << '\t' << lm->to_file << ":" << LAST_SOURCE_LINE (lm) << endl;
}
*/
@@ -591,13 +602,13 @@ namespace
// it is preferred over all others. Use the first one if there are
// several.
//
- line_map const* main_lm (0);
+ line_map_type const* main_lm (0);
include_directive* main_inc (0);
for (includes::map_type::iterator j (i->second.map.begin ());
j != i->second.map.end (); ++j)
{
- line_map const* lm (j->first);
+ line_map_type const* lm (j->first);
if (MAIN_FILE_P (lm))
{
@@ -638,7 +649,7 @@ namespace
for (includes::map_type::iterator j (i->second.map.begin ());
j != i->second.map.end (); ++j)
{
- line_map const* lm (j->first);
+ line_map_type const* lm (j->first);
#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6
string f (lm->to_file);