diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-27 17:24:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-27 17:24:57 +0200 |
commit | 34286111363ca14aae81d50ab16732627425ef72 (patch) | |
tree | 5862221a980e92162380afa4fe31b86efdc5b54d /odb/cxx-lexer.cxx | |
parent | 52793dc8860e38f725dc0ca8300c4e2ca9d4ceb9 (diff) |
GCC 4.7 compatibility changes
Diffstat (limited to 'odb/cxx-lexer.cxx')
-rw-r--r-- | odb/cxx-lexer.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/odb/cxx-lexer.cxx b/odb/cxx-lexer.cxx index 4766639..9a910aa 100644 --- a/odb/cxx-lexer.cxx +++ b/odb/cxx-lexer.cxx @@ -173,10 +173,23 @@ cxx_string_lexer () : reader_ (0) { linemap_init (&line_map_); + +#if BUILDING_GCC_MAJOR > 4 || BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR > 6 + line_map_.round_alloc_size = ggc_round_alloc_size; +#endif + linemap_add (&line_map_, LC_ENTER, 0, "<memory>", 0); reader_ = cpp_create_reader ( - cxx_dialect == cxx0x ? CLK_CXX0X : CLK_CXX98, 0, &line_map_); + cxx_dialect == cxx0x +#if BUILDING_GCC_MAJOR > 4 || BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR > 6 + ? CLK_CXX11 +#else + ? CLK_CXX0X +#endif + : CLK_CXX98, + 0, + &line_map_); if (reader_ == 0) throw bad_alloc (); @@ -190,7 +203,11 @@ cxx_string_lexer:: if (reader_ != 0) cpp_destroy (reader_); + // Was removed as "dead code" in GCC 4.7.0. + // +#if BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR <= 6 linemap_free (&line_map_); +#endif } void cxx_string_lexer:: |