From 19bde3f39ac6d6bb833268a99547436084e50319 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 5ffcd8016a2..32b88573e2e 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 b1eaa637173..4e3b412d7ad 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 "c_types/edge_t.h" #include "c_types/ii_t_rt.h" @@ -59,7 +60,7 @@ class Pgr_edgeColoring : public Pgr_messages { Pgr_edgeColoring(Edge_t*, size_t); 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 830fb78c0d5..c08c6824b51 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 "c_types/coordinate_t.h" @@ -77,7 +78,7 @@ class TSP : public Pgr_messages { TSP(Coordinate_t *, size_t, bool); 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 bde3ff931e3..961a0823d39 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 2336ea1e92c..90a96a707dd 100644 --- a/src/tsp/tsp.cpp +++ b/src/tsp/tsp.cpp @@ -38,6 +38,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.h" @@ -510,7 +511,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";