diff --git a/.gitignore b/.gitignore index 2a68f647..20a3894a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.DS_Store /build -/tags \ No newline at end of file +/tags diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b293cc7..8510b369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,22 @@ cmake_minimum_required(VERSION 2.8.6) set(VERSION "0.1") # $Format:Packaged from commit %H%nset(COMMIT %h)%nset(REFS "%d")$ +function(set_static_flags) +if (NOT APPLE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") +endif() +endfunction(set_static_flags) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CMAKE_CONFIGURATION_TYPES "Debug;Release") enable_testing() include_directories(src contrib/epee/include external "${CMAKE_BINARY_DIR}/version") +if(APPLE) +include_directories(SYSTEM /usr/include/malloc) +endif() + set(STATIC ${MSVC} CACHE BOOL "Link libraries statically") if(MSVC) @@ -65,7 +75,7 @@ else() set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") if(STATIC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") + set_static_flags() endif() endif() @@ -81,7 +91,7 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) if(MINGW) set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock") elseif(NOT MSVC) - set(Boost_LIBRARIES "${Boost_LIBRARIES};rt") + set(Boost_LIBRARIES "${Boost_LIBRARIES}") endif() set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version") diff --git a/contrib/epee/include/serialization/keyvalue_serialization_overloads.h b/contrib/epee/include/serialization/keyvalue_serialization_overloads.h index 54535a40..33486d9e 100644 --- a/contrib/epee/include/serialization/keyvalue_serialization_overloads.h +++ b/contrib/epee/include/serialization/keyvalue_serialization_overloads.h @@ -281,7 +281,7 @@ namespace epee } }; template - struct base_serializable_types: public boost::mpl::vector::type + struct base_serializable_types: public boost::mpl::vector::type {}; //------------------------------------------------------------------------------------------------------------------- template struct selector; @@ -365,4 +365,4 @@ namespace epee return kv_serialization_overloads_impl_is_base_serializable_types, typename std::remove_const::type>::value>::kv_unserialize(d, stg, hparent_section, pname); } } -} \ No newline at end of file +} diff --git a/contrib/epee/include/storages/portable_storage.h b/contrib/epee/include/storages/portable_storage.h index c244dac1..eb8ee2d1 100644 --- a/contrib/epee/include/storages/portable_storage.h +++ b/contrib/epee/include/storages/portable_storage.h @@ -210,7 +210,7 @@ namespace epee template bool portable_storage::get_value(const std::string& value_name, t_value& val, hsection hparent_section) { - BOOST_MPL_ASSERT(( boost::mpl::contains )); + //BOOST_MPL_ASSERT(( boost::mpl::contains )); //TRY_ENTRY(); if(!hparent_section) hparent_section = &m_root; storage_entry* pentry = find_storage_entry(value_name, hparent_section); @@ -476,4 +476,4 @@ namespace epee } //--------------------------------------------------------------------------------------------------------------- } -} \ No newline at end of file +} diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c index d77c52f1..126f0a2f 100644 --- a/src/crypto/oaes_lib.c +++ b/src/crypto/oaes_lib.c @@ -37,6 +37,7 @@ static const char _NR[] = { #include #include #include +#include #ifdef WIN32 #include diff --git a/src/cryptonote_core/cryptonote_format_utils.h b/src/cryptonote_core/cryptonote_format_utils.h index 554e466c..075202d6 100644 --- a/src/cryptonote_core/cryptonote_format_utils.h +++ b/src/cryptonote_core/cryptonote_format_utils.h @@ -25,7 +25,7 @@ namespace cryptonote typedef std::pair output_entry; std::vector outputs; //index + key - uint64_t real_output; //index in outputs vector of real output_entry + size_t real_output; //index in outputs vector of real output_entry crypto::public_key real_out_tx_key; //incoming real tx public key size_t real_output_in_tx_index; //index in transaction outputs vector uint64_t amount; //money diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 4c43f9db..e7b1afe6 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -753,7 +753,9 @@ namespace nodetool template bool node_server::get_local_node_data(basic_node_data& node_data) { - time(&node_data.local_time); + time_t local_time; + time(&local_time); + node_data.local_time = local_time; node_data.peer_id = m_config.m_peer_id; if(!m_hide_my_port) node_data.my_port = m_external_port ? m_external_port : m_listenning_port; diff --git a/src/p2p/p2p_protocol_defs.h b/src/p2p/p2p_protocol_defs.h index 9994dca4..fdf784f4 100644 --- a/src/p2p/p2p_protocol_defs.h +++ b/src/p2p/p2p_protocol_defs.h @@ -86,7 +86,7 @@ namespace nodetool struct basic_node_data { uuid network_id; - time_t local_time; + uint64_t local_time; uint32_t my_port; peerid_type peer_id; @@ -153,7 +153,7 @@ namespace nodetool struct response { - time_t local_time; + uint64_t local_time; t_playload_type payload_data; std::list local_peerlist; diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index bab373c8..a2ea1d91 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2,7 +2,6 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. - #include #include "include_base_utils.h" using namespace epee; @@ -536,7 +535,7 @@ namespace cryptonote if (!have_block) { error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR; - error_resp.message = "Internal error: can't get block by height. Height = " + req.height + '.'; + error_resp.message = "Internal error: can't get block by height. Height = " + std::to_string(req.height) + '.'; return false; } bool responce_filled = fill_block_header_responce(blk, false, req.height, block_hash, res.block_header); diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index a4cae048..a9c171f6 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -469,7 +469,7 @@ bool simple_wallet::refresh(const std::vector& args) return true; message_writer() << "Starting refresh..."; - uint64_t fetched_blocks = 0; + size_t fetched_blocks = 0; bool ok = false; std::ostringstream ss; try diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index f0032351..2742abaf 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -425,6 +425,7 @@ bool fill_tx_sources(std::vector& sources, const std::vector