diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index fc2908ab1..6a58033f3 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -3,7 +3,7 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2014-2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2014, 2015. // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -183,7 +184,7 @@ inline bool range_ok(Range const& range, Point& centroid) else if (n <= 0) { #if ! defined(BOOST_GEOMETRY_CENTROID_NO_THROW) - throw centroid_exception(); + BOOST_THROW_EXCEPTION(centroid_exception()); #else return false; #endif @@ -366,7 +367,7 @@ struct centroid_multi // to calculate the centroid if (geometry::is_empty(multi)) { - throw centroid_exception(); + BOOST_THROW_EXCEPTION(centroid_exception()); } #endif diff --git a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp index 2ebf17c96..9a388a4d8 100644 --- a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp +++ b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2017. // Modifications copyright (c) 2017 Oracle and/or its affiliates. @@ -16,6 +17,8 @@ #include #include +#include + #include #include #include @@ -118,7 +121,7 @@ inline bool has_self_intersections(Geometry const& geometry, #if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) if (throw_on_self_intersection) { - throw overlay_invalid_input_exception(); + BOOST_THROW_EXCEPTION(overlay_invalid_input_exception()); } #endif return true; diff --git a/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp b/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp index b9e48cdbf..c249ff57f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp @@ -1,5 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + // Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. @@ -15,6 +17,7 @@ #include #include +#include #include #include @@ -307,7 +310,7 @@ public: #if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) if (enter_count != 0) { - throw inconsistent_turns_exception(); + BOOST_THROW_EXCEPTION(inconsistent_turns_exception()); } #else BOOST_GEOMETRY_ASSERT(enter_count == 0); diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 832acc078..b356ec70b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2015, 2017. // Modifications copyright (c) 2015-2017 Oracle and/or its affiliates. @@ -16,6 +17,7 @@ #include +#include #include #include @@ -1102,7 +1104,7 @@ struct get_turn_info std::cout << "TURN: Unknown method: " << method << std::endl; #endif #if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) - throw turn_info_exception(method); + BOOST_THROW_EXCEPTION(turn_info_exception(method)); #endif } break; diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp index 76f87a5de..46c1305cd 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2013, 2014, 2015, 2017. // Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. @@ -14,6 +15,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_LA_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_LA_HPP +#include + #include #include @@ -404,7 +407,7 @@ struct get_turn_info_linear_areal std::cout << "TURN: Unknown method: " << method << std::endl; #endif #if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) - throw turn_info_exception(method); + BOOST_THROW_EXCEPTION(turn_info_exception(method)); #endif } break; diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp index 9d1f10787..58fd4bb5c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2013, 2014, 2015, 2017. // Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. @@ -14,6 +15,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_LL_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_LL_HPP +#include + #include #include @@ -472,7 +475,7 @@ struct get_turn_info_linear_linear std::cout << "TURN: Unknown method: " << method << std::endl; #endif #if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) - throw turn_info_exception(method); + BOOST_THROW_EXCEPTION(turn_info_exception(method)); #endif } break; diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp index a92badf65..07287dc62 100644 --- a/include/boost/geometry/algorithms/detail/relate/result.hpp +++ b/include/boost/geometry/algorithms/detail/relate/result.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2013-2016. // Modifications copyright (c) 2013-2016 Oracle and/or its affiliates. @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -266,7 +268,7 @@ private: || ( c >= '0' && c <= '9' ); if ( !is_valid ) { - throw geometry::invalid_input_exception(); + BOOST_THROW_EXCEPTION(geometry::invalid_input_exception()); } } diff --git a/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp b/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp index 2f82e1a8b..3d45a46d1 100644 --- a/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp +++ b/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2015. // Modifications copyright (c) 2015, Oracle and/or its affiliates. @@ -16,9 +17,13 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_THROW_ON_EMPTY_INPUT_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_THROW_ON_EMPTY_INPUT_HPP + #include #include +#include + + // BSG 2012-02-06: we use this currently only for distance. // For other scalar results area,length,perimeter it is commented on purpose. // Reason is that for distance there is no other choice. distance of two @@ -46,7 +51,7 @@ inline void throw_on_empty_input(Geometry const& geometry) #if ! defined(BOOST_GEOMETRY_EMPTY_INPUT_NO_THROW) if (geometry::is_empty(geometry)) { - throw empty_input_exception(); + BOOST_THROW_EXCEPTION(empty_input_exception()); } #else boost::ignore_unused(geometry); diff --git a/include/boost/geometry/io/wkt/read.hpp b/include/boost/geometry/io/wkt/read.hpp index a6990329e..236690dc2 100644 --- a/include/boost/geometry/io/wkt/read.hpp +++ b/include/boost/geometry/io/wkt/read.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2014, 2015. // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. @@ -31,6 +32,7 @@ #include #include #include +#include #include #include @@ -139,15 +141,15 @@ struct parsing_assigner } catch(boost::bad_lexical_cast const& blc) { - throw read_wkt_exception(blc.what(), it, end, wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception(blc.what(), it, end, wkt)); } catch(std::exception const& e) { - throw read_wkt_exception(e.what(), it, end, wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception(e.what(), it, end, wkt)); } catch(...) { - throw read_wkt_exception("", it, end, wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("", it, end, wkt)); } parsing_assigner::apply( @@ -175,7 +177,7 @@ inline void handle_open_parenthesis(Iterator& it, { if (it == end || *it != "(") { - throw read_wkt_exception("Expected '('", it, end, wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Expected '('", it, end, wkt)); } ++it; } @@ -192,7 +194,7 @@ inline void handle_close_parenthesis(Iterator& it, } else { - throw read_wkt_exception("Expected ')'", it, end, wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Expected ')'", it, end, wkt)); } } @@ -203,7 +205,7 @@ inline void check_end(Iterator& it, { if (it != end) { - throw read_wkt_exception("Too many tokens", it, end, wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Too many tokens", it, end, wkt)); } } @@ -529,7 +531,7 @@ inline bool initialize(tokenizer const& tokens, if (has_z && dimension::type::value < 3) { - throw read_wkt_exception("Z only allowed for 3 or more dimensions", wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Z only allowed for 3 or more dimensions", wkt)); } #if defined(_MSC_VER) @@ -545,7 +547,7 @@ inline bool initialize(tokenizer const& tokens, return true; } - throw read_wkt_exception(std::string("Should start with '") + geometry_name + "'", wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception(std::string("Should start with '") + geometry_name + "'", wkt)); } @@ -702,7 +704,7 @@ struct box_parser } else { - throw read_wkt_exception("Should start with 'POLYGON' or 'BOX'", wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Should start with 'POLYGON' or 'BOX'", wkt)); } typedef typename point_type::type point_type; @@ -729,7 +731,7 @@ struct box_parser } else { - throw read_wkt_exception("Box should have 2,4 or 5 points", wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Box should have 2,4 or 5 points", wkt)); } geometry::detail::assign_point_to_index(points.front(), box); @@ -760,7 +762,7 @@ struct segment_parser } else { - throw read_wkt_exception("Should start with 'LINESTRING' or 'SEGMENT'", wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Should start with 'LINESTRING' or 'SEGMENT'", wkt)); } typedef typename point_type::type point_type; @@ -776,7 +778,7 @@ struct segment_parser } else { - throw read_wkt_exception("Segment should have 2 points", wkt); + BOOST_THROW_EXCEPTION(read_wkt_exception("Segment should have 2 points", wkt)); } }