Skip to content

Commit

Permalink
Support for newer boost versions above 1.70 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallaigy authored Dec 30, 2020
1 parent efa5936 commit ebbffbc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ add_definitions(${LLVM_DEFINITIONS})
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")

# Get boost
find_package(Boost REQUIRED)
find_package(Boost 1.70 REQUIRED)
include_directories(${Boost_INCLUDE_DIR})

add_definitions(-DBOOST_NO_RTTI -DBOOST_EXCEPTION_DISABLE -DBOOST_NO_EXCEPTIONS)
Expand Down
3 changes: 3 additions & 0 deletions include/gazer/Core/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ struct simplify_type<const gazer::ExprRef<T>> {

} // end namespace llvm

#if BOOST_VERSION < 107400
// Boost 1.74 introduced std::hash specialization for smart pointers, but we officially support 1.70.
namespace std
{

Expand All @@ -358,5 +360,6 @@ struct hash<gazer::ExprRef<T>>
};

} // end namespace std
#endif

#endif
7 changes: 7 additions & 0 deletions src/Core/GazerContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ namespace boost
#endif
std::terminate();
}

#if BOOST_VERSION >= 107300
void throw_exception(std::exception const &e, boost::source_location const&)
{
boost::throw_exception(e);
}
#endif
} // end namespace boost
#endif

Expand Down

0 comments on commit ebbffbc

Please sign in to comment.