aboutsummaryrefslogtreecommitdiff
path: root/odb/gcc-fwd.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-05-05 15:02:44 -0700
committerBoris Kolpackov <boris@codesynthesis.com>2014-05-05 15:02:44 -0700
commit97281fd4454596834142fa43f83af38695b38e5b (patch)
treee39e42c289a8c4db27a12ff4eaff01b7b905f6cf /odb/gcc-fwd.hxx
parente8c365d6d0ba4c969819b4c6aacab54ad7461a00 (diff)
GCC 4.9.0 compatibility fixes
Diffstat (limited to 'odb/gcc-fwd.hxx')
-rw-r--r--odb/gcc-fwd.hxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/odb/gcc-fwd.hxx b/odb/gcc-fwd.hxx
index d459a9d..38f9819 100644
--- a/odb/gcc-fwd.hxx
+++ b/odb/gcc-fwd.hxx
@@ -5,8 +5,26 @@
#ifndef ODB_GCC_FWD_HXX
#define ODB_GCC_FWD_HXX
+#include <bversion.h>
+
+#if BUILDING_GCC_MAJOR > 4 || BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR > 8
+# include <limits.h> // CHAR_BIT
+# include <config.h>
+#endif
+
extern "C"
{
+// The hwint.h header uses gcc_checking_assert macro from system.h. But
+// if we include system.h here, it pulls in all kinds of GCC trouble that
+// "poisons" standard C/C++ declarations (see safe-ctype.h for an example).
+// Instead we are just going to provide the no-op definition of this macro.
+//
+#if BUILDING_GCC_MAJOR > 4 || BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR > 8
+# define gcc_checking_assert(expr) ((void)(0 & (expr)))
+# include <hwint.h>
+# undef gcc_checking_assert
+#endif
+
#include <coretypes.h>
typedef unsigned int source_location; // <line-map.h>