From f4c99cdbb9f6123b33e29cb810c8781b5a2ba125 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 3 Jul 2014 15:00:22 +0200 Subject: [PATCH] Windows build coersions. --- CMakeLists.txt | 7 +++++-- Compiler.cpp | 6 +++++- Parser.cpp | 13 ++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2356b7d9d..99d6d980f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,11 @@ aux_source_directory(. SRC_LIST) set(EXECUTABLE lll) # set(CMAKE_INSTALL_PREFIX ../lib) -add_library(${EXECUTABLE} SHARED ${SRC_LIST}) +if(ETH_STATIC) + add_library(${EXECUTABLE} STATIC ${SRC_LIST}) +else() + add_library(${EXECUTABLE} SHARED ${SRC_LIST}) +endif() file(GLOB HEADERS "*.h") @@ -15,7 +19,6 @@ include_directories(..) target_link_libraries(${EXECUTABLE} evmface) target_link_libraries(${EXECUTABLE} ethential) -target_link_libraries(${EXECUTABLE} gmp) if(${TARGET_PLATFORM} STREQUAL "w64") diff --git a/Compiler.cpp b/Compiler.cpp index 0faf478d6..1621acf90 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -84,7 +84,11 @@ std::string eth::compileLLLToAsm(std::string const& _src, bool _opt, std::vector string eth::parseLLL(string const& _src) { sp::utree o; - parseTreeLLL(_src, o); + try + { + parseTreeLLL(_src, o); + } + catch (...) {} ostringstream ret; debugOutAST(ret, o); killBigints(o); diff --git a/Parser.cpp b/Parser.cpp index d7658f672..4adcdd0eb 100644 --- a/Parser.cpp +++ b/Parser.cpp @@ -21,6 +21,8 @@ #include "Parser.h" +#define BOOST_RESULT_OF_USE_DECLTYPE +#define BOOST_SPIRIT_USE_PHOENIX_V3 #include #include #include @@ -93,12 +95,13 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out) qi::rule list = '(' > *element > ')'; // todo: fix compound compile errors in this line for Visual Studio 2013 -#ifndef _MSC_VER - qi::rule extra = sload[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 2)] | mload[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 1)] | sstore[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 4)] | mstore[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 3)] | seq[qi::_val = qi::_1, bind(&sp::utree::tag, qi::_val, 5)]; +//#ifndef _MSC_VER + auto x = [](int a) { return [=](sp::utree& n, typename qi::rule::context_type& c) { (boost::fusion::at_c<0>(c.attributes) = n).tag(a); }; }; + qi::rule extra = mload[x(1)] | sload[x(2)] | mstore[x(3)] | sstore[x(4)] | seq[x(5)]; element = atom | list | extra; -#else - element = atom | list/* | extra*/; -#endif +/*#else + element = atom | list; +#endif*/ string s;