Skip to content

Commit ebbffbc

Browse files
authoredDec 30, 2020
Support for newer boost versions above 1.70 (#74)
1 parent efa5936 commit ebbffbc

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
 

‎CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ add_definitions(${LLVM_DEFINITIONS})
6767
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
6868

6969
# Get boost
70-
find_package(Boost REQUIRED)
70+
find_package(Boost 1.70 REQUIRED)
7171
include_directories(${Boost_INCLUDE_DIR})
7272

7373
add_definitions(-DBOOST_NO_RTTI -DBOOST_EXCEPTION_DISABLE -DBOOST_NO_EXCEPTIONS)

‎include/gazer/Core/Expr.h

+3
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ struct simplify_type<const gazer::ExprRef<T>> {
338338

339339
} // end namespace llvm
340340

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

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

360362
} // end namespace std
363+
#endif
361364

362365
#endif

‎src/Core/GazerContext.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ namespace boost
3434
#endif
3535
std::terminate();
3636
}
37+
38+
#if BOOST_VERSION >= 107300
39+
void throw_exception(std::exception const &e, boost::source_location const&)
40+
{
41+
boost::throw_exception(e);
42+
}
43+
#endif
3744
} // end namespace boost
3845
#endif
3946

0 commit comments

Comments
 (0)
Please sign in to comment.