From f15ec3f4a28e7fbef8880d05bc163f7a8dda250d Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 2 Mar 2013 11:29:23 +0000 Subject: Fix build with C++11 Fixed bugs: - https://launchpad.net/bugs/858814 (bzr r12166) --- src/display/nr-filter-turbulence.cpp | 5 +++++ src/extension/internal/filter/paint.h | 2 +- src/isinf.h | 3 +++ src/sp-guide.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/display/nr-filter-turbulence.cpp b/src/display/nr-filter-turbulence.cpp index 76b877fbc..333074f55 100644 --- a/src/display/nr-filter-turbulence.cpp +++ b/src/display/nr-filter-turbulence.cpp @@ -283,7 +283,12 @@ private: // other constants static int const BSize = 0x100; static int const BMask = 0xff; + +#if __cplusplus < 201103L static double const PerlinOffset = 4096.0; +#else + static double constexpr PerlinOffset = 4096.0; +#endif Geom::Rect _tile; Geom::Point _baseFreq; diff --git a/src/extension/internal/filter/paint.h b/src/extension/internal/filter/paint.h index ad396e08f..f04dd92f9 100644 --- a/src/extension/internal/filter/paint.h +++ b/src/extension/internal/filter/paint.h @@ -88,7 +88,7 @@ public: "10\n" "1\n" "\n" - "\n" + "\n" "true\n" "1000\n" "1000\n" diff --git a/src/isinf.h b/src/isinf.h index 7799d2876..b4c56f79d 100644 --- a/src/isinf.h +++ b/src/isinf.h @@ -12,6 +12,9 @@ #elif defined(__APPLE__) && __GNUC__ == 3 #define isinf(x) __isinf(x) +#elif __cplusplus >= 201103L +# include +# define isinf std::isinf #endif #endif /* __ISINF_H__ */ diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 7445b0b75..48596cbc0 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -280,10 +280,10 @@ sp_guide_create_guides_around_page(SPDesktop *dt) { Geom::Point B(C[Geom::X], 0); Geom::Point D(0, C[Geom::Y]); - pts.push_back(std::make_pair(A, B)); - pts.push_back(std::make_pair(B, C)); - pts.push_back(std::make_pair(C, D)); - pts.push_back(std::make_pair(D, A)); + pts.push_back(std::pair(A, B)); + pts.push_back(std::pair(B, C)); + pts.push_back(std::pair(C, D)); + pts.push_back(std::pair(D, A)); sp_guide_pt_pairs_to_guides(doc, pts); -- cgit v1.2.3