Skip to content

Commit

Permalink
Patch exprtk on Clang < 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Nov 14, 2017
1 parent 231cc82 commit 3d6b3e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/Xpressive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_rtl_io_file")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_rtl_vecops")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WERROR_FLAGS} -fexceptions")

# Clang < 3.9 bug
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.9")
EXECUTE_PROCESS(COMMAND patch exprtk/exprtk.hpp exprtk.hpp.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_QUIET)
ENDIF()
ENDIF()

IF(LMMS_BUILD_WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -Dexprtk_disable_enhanced_features")
ENDIF()
Expand Down
13 changes: 13 additions & 0 deletions plugins/Xpressive/exprtk.hpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/exprtk.hpp b/exprtk.hpp
index 916e74b..ae7de24 100644
--- a/exprtk.hpp
+++ b/exprtk.hpp
@@ -1962,7 +1962,7 @@ namespace exprtk
template <typename T>
inline bool string_to_real(const std::string& s, T& t)
{
- const typename numeric::details::number_type<T>::type num_type;
+ typename numeric::details::number_type<T>::type num_type;

const char_t* begin = s.data();
const char_t* end = s.data() + s.size();

0 comments on commit 3d6b3e0

Please sign in to comment.