From a1543b359fb6ace72cd04352dd20c0406d36a6ad Mon Sep 17 00:00:00 2001 From: Tomek Dubrownik Date: Sat, 29 Sep 2018 13:43:44 +0800 Subject: [PATCH] Compatibility patch for Boost GIL v1.68 A number of basic typedef were removed in the Boost GIL 1.68 release, notably `bits32` and `bits32f`. Additionally the `GIL_DEFINE_ALL_TYPEDEFS` macro signature changed. This commit introduces compatibility type aliases and conditionally calls the new macro if `BOOST_VERSION` is high enough. --- deps/boost/gil/extension/toolbox/hsl.hpp | 6 +++++- deps/boost/gil/extension/toolbox/hsv.hpp | 8 +++++++- include/mapnik/image_filter.hpp | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/deps/boost/gil/extension/toolbox/hsl.hpp b/deps/boost/gil/extension/toolbox/hsl.hpp index 620ae78ed..5715e7254 100644 --- a/deps/boost/gil/extension/toolbox/hsl.hpp +++ b/deps/boost/gil/extension/toolbox/hsl.hpp @@ -48,8 +48,12 @@ typedef mpl::vector3< hsl_color_space::hue_t /// \ingroup LayoutModel typedef layout hsl_layout_t; - +#if BOOST_VERSION >= 106800 +using bits32f = boost::gil::float32_t; +GIL_DEFINE_ALL_TYPEDEFS( 32f, float32_t, hsl ); +#else GIL_DEFINE_ALL_TYPEDEFS( 32f, hsl ); +#endif /// \ingroup ColorConvert /// \brief RGB to HSL diff --git a/deps/boost/gil/extension/toolbox/hsv.hpp b/deps/boost/gil/extension/toolbox/hsv.hpp index 90ca8cbc0..0d0a754d6 100644 --- a/deps/boost/gil/extension/toolbox/hsv.hpp +++ b/deps/boost/gil/extension/toolbox/hsv.hpp @@ -49,7 +49,13 @@ typedef mpl::vector3< hsv_color_space::hue_t typedef layout hsv_layout_t; -GIL_DEFINE_ALL_TYPEDEFS( 32f, hsv ) +#if BOOST_VERSION >= 106800 +using bits32 = uint32_t; +using bits32f = float32_t; +GIL_DEFINE_ALL_TYPEDEFS( 32f, float32_t, hsv ) +#else +GIL_DEFINE_ALL_TYPEDEFS( 32f, hsv ); +#endif /// \ingroup ColorConvert /// \brief RGB to HSV diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index 189b29e34..f39eb950c 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -52,6 +52,14 @@ // stl #include +#if BOOST_VERSION >= 106800 +namespace boost { +namespace gil { + using bits32f = boost::gil::float32_t; +} +} +#endif + // 8-bit YUV //Y = ( ( 66 * R + 129 * G + 25 * B + 128) >> 8) + 16 //U = ( ( -38 * R - 74 * G + 112 * B + 128) >> 8) + 128