From 34286111363ca14aae81d50ab16732627425ef72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Apr 2012 17:24:57 +0200 Subject: GCC 4.7 compatibility changes --- odb/cxx-lexer.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'odb/cxx-lexer.cxx') 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, "", 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:: -- cgit v1.1