Patch exprtk on Clang (#3971)

This commit is contained in:
Tres Finocchiaro
2017-11-14 01:28:38 -05:00
committed by GitHub
parent 231cc82de1
commit 28a4eb27f2
2 changed files with 19 additions and 0 deletions

View File

@@ -10,6 +10,12 @@ 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")
# See https://github.com/ArashPartow/exprtk/pull/9
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
EXECUTE_PROCESS(COMMAND patch exprtk/exprtk.hpp exprtk.hpp.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_QUIET)
ENDIF()
IF(LMMS_BUILD_WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -Dexprtk_disable_enhanced_features")
ENDIF()

View File

@@ -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();