Skip to content

Commit

Permalink
applied build fixes for newer gcc from cryptonote vkobel:fix-arch-com…
Browse files Browse the repository at this point in the history
…pile-errors
  • Loading branch information
jamison-phillips committed Aug 25, 2017
1 parent 72946d9 commit 9f8a67d
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 20 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Royalties

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ You may download them from:
Alternatively, it may be possible to install them using a package manager.

To build:
Change to the directory where this file is located and run these commands:
Run these commands:
```
cd ~
git clone https://github.com/Vetro7/RoyaltiesCLI RoyaltiesCLI
cd RoyaltiesCLI
mkdir build
cd build
cmake
cd
cmake ..
cd ..
make
```

To build, change to a directory where this file is located, and run `make`. The resulting executables can be found in `build/release/src`.
The resulting executables can be found in `RoyaltiesCLI/build/release/src`.

#### Advanced options:

Expand Down
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ if (MSVC)
target_link_libraries(System ws2_32)
endif ()

set(ConnectivityToolLibs CryptoNoteCore Common Logging Crypto P2P Rpc Http Serialization System ${Boost_LIBRARIES})
target_link_libraries(ConnectivityTool ${ConnectivityToolLibs} ${ConnectivityToolLibs})
target_link_libraries(Daemon CryptoNoteCore P2P Rpc Serialization System Http Logging Common Crypto upnpc-static BlockchainExplorer ${Boost_LIBRARIES})
target_link_libraries(SimpleWallet Wallet NodeRpcProxy Transfers Rpc Http Serialization CryptoNoteCore System Logging Common Crypto ${Boost_LIBRARIES})
target_link_libraries(PaymentGateService PaymentGate JsonRpcServer Wallet NodeRpcProxy Transfers CryptoNoteCore Crypto P2P Rpc Http Serialization System Logging Common InProcessNode upnpc-static BlockchainExplorer ${Boost_LIBRARIES})
target_link_libraries(Miner CryptoNoteCore Rpc Serialization System Http Logging Common Crypto ${Boost_LIBRARIES})
set(ConnectivityToolLibs CryptoNoteCore Logging Crypto P2P Rpc Http Serialization Common System ${Boost_LIBRARIES})
target_link_libraries(ConnectivityTool ${ConnectivityToolLibs})
target_link_libraries(Daemon CryptoNoteCore P2P Rpc System Http Logging Common Crypto upnpc-static BlockchainExplorer ${Boost_LIBRARIES} Serialization)
target_link_libraries(SimpleWallet Wallet NodeRpcProxy Transfers Rpc Http CryptoNoteCore System Logging Common Crypto ${Boost_LIBRARIES} Serialization)
target_link_libraries(PaymentGateService PaymentGate JsonRpcServer Wallet NodeRpcProxy Transfers CryptoNoteCore Crypto P2P Rpc Http System Logging Common InProcessNode upnpc-static BlockchainExplorer ${Boost_LIBRARIES} Serialization)
target_link_libraries(Miner CryptoNoteCore Rpc System Http Logging Common Crypto ${Boost_LIBRARIES} Serialization)

add_dependencies(Rpc version)

Expand Down
3 changes: 2 additions & 1 deletion src/CryptoNoteConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const size_t CRYPTONOTE_MAX_TX_SIZE = 1000000000;
const uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0x971b5; // addresses start with "XRY1"
const size_t CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW = 10;
const uint64_t CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT = 60 * 60 * 2;
const uint64_t CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE = 10;

const size_t BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW = 30;

Expand Down Expand Up @@ -147,7 +148,7 @@ __attribute__((unused))
// You may add here other checkpoints using the following format:
// {<block height>, "<block hash>"},
const std::initializer_list<CheckpointData> CHECKPOINTS = {

{ 3700, "cbce7c37dbad257d29a3bfa93ec1f7b92434b9b806d40d01cb04d0ad2e451735" },
};

} // CryptoNote
Expand Down
2 changes: 1 addition & 1 deletion src/CryptoNoteCore/SwappedMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ template<class Key, class T> bool SwappedMap<Key, T>::open(const std::string& it
}

template<class Key, class T> void SwappedMap<Key, T>::close() {
std::cout << "SwappedMap cache hits: " << m_cacheHits << ", misses: " << m_cacheMisses << " (" << std::fixed << std::setprecision(2) << static_cast<double>(m_cacheMisses) / (m_cacheHits + m_cacheMisses) * 100 << "%)" << std::endl;
//std::cout << "SwappedMap cache hits: " << m_cacheHits << ", misses: " << m_cacheMisses << " (" << std::fixed << std::setprecision(2) << static_cast<double>(m_cacheMisses) / (m_cacheHits + m_cacheMisses) * 100 << "%)" << std::endl;
}

template<class Key, class T> uint64_t SwappedMap<Key, T>::size() const {
Expand Down
4 changes: 2 additions & 2 deletions src/Platform/Linux/System/TcpConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ size_t TcpConnection::read(uint8_t* data, size_t size) {
std::string message;
ssize_t transferred = ::recv(connection, (void *)data, size, 0);
if (transferred == -1) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
if (errno != EAGAIN){
message = "recv failed, " + lastErrorMessage();
} else {
epoll_event connectionEvent;
Expand Down Expand Up @@ -167,7 +167,7 @@ std::size_t TcpConnection::write(const uint8_t* data, size_t size) {

ssize_t transferred = ::send(connection, (void *)data, size, MSG_NOSIGNAL);
if (transferred == -1) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
if (errno != EAGAIN){
message = "send failed, " + lastErrorMessage();
} else {
epoll_event connectionEvent;
Expand Down
2 changes: 1 addition & 1 deletion src/Platform/Linux/System/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void Timer::sleep(std::chrono::nanoseconds duration) {
if (!timerContext->interrupted) {
uint64_t value = 0;
if(::read(timer, &value, sizeof value) == -1 ){
if(errno == EAGAIN || errno == EWOULDBLOCK) {
if(errno == EAGAIN){
timerContext->interrupted = true;
dispatcher->pushContext(timerContext->context);
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/WalletLegacy/WalletLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "WalletLegacy/WalletLegacySerializer.h"
#include "WalletLegacy/WalletUtils.h"

#include "CryptoNoteConfig.h"

using namespace Crypto;

namespace {
Expand Down Expand Up @@ -198,7 +200,7 @@ void WalletLegacy::initAndLoad(std::istream& source, const std::string& password
void WalletLegacy::initSync() {
AccountSubscription sub;
sub.keys = reinterpret_cast<const AccountKeys&>(m_account.getAccountKeys());
sub.transactionSpendableAge = 6;
sub.transactionSpendableAge = CryptoNote::parameters::CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE;
sub.syncStart.height = 0;
sub.syncStart.timestamp = m_account.get_createtime() - ACCOUN_CREATE_TIME_ACCURACY;

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ namespace Crypto {
};

static inline size_t rs_comm_size(size_t pubs_count) {
return sizeof(rs_comm) + pubs_count * sizeof(rs_comm().ab[0]);
return sizeof(rs_comm) + pubs_count * sizeof(((rs_comm*)0)->ab[0]);
}

void crypto_ops::generate_ring_signature(const Hash &prefix_hash, const KeyImage &image,
Expand Down
6 changes: 3 additions & 3 deletions src/crypto/slow-hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ namespace Crypto {
}

cn_context::~cn_context() {
if (munmap(data, MAP_SIZE) != 0) {
throw bad_alloc();
}
//if (munmap(data, MAP_SIZE) != 0) {
// throw bad_alloc();
//}
}

#endif
Expand Down

0 comments on commit 9f8a67d

Please sign in to comment.