From 4654f49d5c36832fb65505872cb10b9b21c58f2d Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 7 Dec 2014 13:57:55 -0800 Subject: [PATCH] Fix build on older versions of gcc Gcc 4.7 thinks there's a conflict with C99 stdint macros and C++, even with -std=c++11. --- src/libqof/qof/gnc-int128.cpp | 2 -- src/libqof/qof/gnc-int128.hpp | 9 +++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libqof/qof/gnc-int128.cpp b/src/libqof/qof/gnc-int128.cpp index 3b9997c9ff..0bcdc5fc22 100644 --- a/src/libqof/qof/gnc-int128.cpp +++ b/src/libqof/qof/gnc-int128.cpp @@ -24,7 +24,6 @@ extern "C" { #include "config.h" -#include } #include "gnc-int128.hpp" @@ -920,4 +919,3 @@ operator>> (GncInt128 a, uint b) noexcept a >>= b; return a; } - diff --git a/src/libqof/qof/gnc-int128.hpp b/src/libqof/qof/gnc-int128.hpp index efbfdba3bd..0cfab84103 100644 --- a/src/libqof/qof/gnc-int128.hpp +++ b/src/libqof/qof/gnc-int128.hpp @@ -25,7 +25,13 @@ #ifndef GNCINT128_H #define GNCINT128_H -#include +extern "C" +{ +#define __STDC_LIMIT_MACROS 1 +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_FORMAT_MACROS 1 +#include +} #include #include @@ -248,7 +254,6 @@ GncInt128 gcd (int64_t a, int64_t b); /** Compute the least common multiple of two integers */ GncInt128 lcm (int64_t a, int64_t b); - #endif //GNCINT128_H /** @} */