From abea1a2d8eaf9f30bc3c8d86eb1d0d7e2575f9b5 Mon Sep 17 00:00:00 2001 From: vslashg Date: Tue, 3 Oct 2023 21:01:23 +0000 Subject: [PATCH] Remove the Boost_VERSION_MACRO define from C++ Boost provides a header, , which provides a BOOST_VERSION macro with the same semantics. This change simplifies the build process and makes this project easier to incorporate in other build systems. --- CMakeLists.txt | 1 - include/coloring/pgr_edgeColoring.hpp | 3 ++- include/tsp/tsp.hpp | 3 ++- src/alpha_shape/pgr_alphaShape.cpp | 3 ++- src/tsp/tsp.cpp | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45040f396b..b50b854ea5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,6 @@ find_package(Boost ${BOOST_MINIMUM_VERSION} REQUIRED) if (NOT Boost_VERSION_MACRO) set(Boost_VERSION_MACRO ${Boost_VERSION}) endif() -add_definitions(-DBoost_VERSION_MACRO=${Boost_VERSION_MACRO}) set(BOOST_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") include(CheckCCompilerFlag) diff --git a/include/coloring/pgr_edgeColoring.hpp b/include/coloring/pgr_edgeColoring.hpp index eeb6a53f15..f697ea967a 100644 --- a/include/coloring/pgr_edgeColoring.hpp +++ b/include/coloring/pgr_edgeColoring.hpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include "cpp_common/edge_t.hpp" #include "c_types/ii_t_rt.h" @@ -59,7 +60,7 @@ class Pgr_edgeColoring : public Pgr_messages { explicit Pgr_edgeColoring(const std::vector&); Pgr_edgeColoring() = delete; -#if Boost_VERSION_MACRO >= 106800 +#if BOOST_VERSION >= 106800 friend std::ostream& operator<<(std::ostream &, const Pgr_edgeColoring&); #endif diff --git a/include/tsp/tsp.hpp b/include/tsp/tsp.hpp index ef9e549c33..8933af6b77 100644 --- a/include/tsp/tsp.hpp +++ b/include/tsp/tsp.hpp @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include +#include #include "c_types/iid_t_rt.h" #include "cpp_common/coordinate_t.hpp" @@ -77,7 +78,7 @@ class TSP : public Pgr_messages { explicit TSP(const std::vector&); TSP() = delete; -#if Boost_VERSION_MACRO >= 106800 +#if BOOST_VERSION >= 106800 friend std::ostream& operator<<(std::ostream &, const TSP&); #endif bool has_vertex(int64_t id) const; diff --git a/src/alpha_shape/pgr_alphaShape.cpp b/src/alpha_shape/pgr_alphaShape.cpp index b6bad91ee2..adbe522ea0 100644 --- a/src/alpha_shape/pgr_alphaShape.cpp +++ b/src/alpha_shape/pgr_alphaShape.cpp @@ -41,7 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include -#if Boost_VERSION_MACRO >= 107500 +#include +#if BOOST_VERSION >= 107500 # include #else # include diff --git a/src/tsp/tsp.cpp b/src/tsp/tsp.cpp index 67f7258a85..e969897135 100644 --- a/src/tsp/tsp.cpp +++ b/src/tsp/tsp.cpp @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include #include "cpp_common/identifiers.hpp" #include "cpp_common/pgr_messages.hpp" @@ -503,7 +504,7 @@ TSP::get_edge_id(E e) const { -#if Boost_VERSION_MACRO >= 106800 +#if BOOST_VERSION >= 106800 std::ostream& operator<<(std::ostream &log, const TSP& data) { log << "Number of Vertices is:" << num_vertices(data.graph) << "\n"; log << "Number of Edges is:" << num_edges(data.graph) << "\n";