From 511dcf67322ad87fb32f97d1cf7725c129e83898 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Feb 2016 16:01:42 +0200 Subject: Initial work to make ODB compatible with GCC 6 --- odb/gcc-fwd.hxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'odb/gcc-fwd.hxx') diff --git a/odb/gcc-fwd.hxx b/odb/gcc-fwd.hxx index a120f05..618b106 100644 --- a/odb/gcc-fwd.hxx +++ b/odb/gcc-fwd.hxx @@ -7,6 +7,24 @@ #include +#if BUILDING_GCC_MAJOR >= 6 + +// If we include here, it pulls in all kinds of GCC trouble that +// "poisons" standard C/C++ declarations; see safe-ctype.h. So instead we +// are going to "exclude" safe-ctype.h. To compensate, however, we will +// include it first thing in gcc.hxx. +// +# include +# define SAFE_CTYPE_H +# include +# undef SAFE_CTYPE_H +# include + +typedef unsigned int source_location; // +typedef source_location location_t; // + +#else // GCC < 6 + #if BUILDING_GCC_MAJOR > 4 || BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR > 8 # include // CHAR_BIT # include @@ -33,6 +51,9 @@ extern "C" typedef unsigned int source_location; // typedef source_location location_t; // -} + +} // extern "C" + +#endif #endif // ODB_GCC_FWD_HXX -- cgit v1.1