From 8906eb04451327bb4b0007107fd6279d50446c70 Mon Sep 17 00:00:00 2001 From: ajochems Date: Tue, 19 Apr 2016 23:43:21 +0000 Subject: [PATCH] Linux compilation fix --- src/leveldb/Makefile | 2 +- src/makefile.unix | 6 +++--- src/util.cpp | 9 +++++---- src/walletdb.h | 2 ++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/leveldb/Makefile b/src/leveldb/Makefile index 20c9c4f..840d29e 100644 --- a/src/leveldb/Makefile +++ b/src/leveldb/Makefile @@ -18,7 +18,7 @@ $(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \ include build_config.mk CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) -CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) +CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -std=c++14 LDFLAGS += $(PLATFORM_LDFLAGS) LIBS += $(PLATFORM_LIBS) diff --git a/src/makefile.unix b/src/makefile.unix index 0e5ada9..f50dea2 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -17,13 +17,13 @@ USE_QRCODE=1 # define libraries BOOST_LIB_PATH=$HOME/deps/boost_1_60_0/stage/lib -BDB_LIB_PATH=$HOME/deps/db-4.8.30.NC/build_unix +BDB_LIB_PATH=$HOME/deps/db-5.1.29.NC/build_unix OPENSSL_LIB_PATH=$HOME/deps/openssl-1.0.2g MINIUPNPC_LIB_PATH=$HOME/deps/miniupnpc-1.9 # define includes BOOST_INCLUDE_PATH=$HOME/deps/boost_1_60_0 -BDB_INCLUDE_PATH=$HOME/deps/db-4.8.30.NC/build_unix +BDB_INCLUDE_PATH=$HOME/deps/db-5.1.29.NC/build_unix OPENSSL_INCLUDE_PATH=$HOME/deps/openssl-1.0.2g MINIUPNPC_INCLUDE_PATH=$HOME/deps/miniupnpc-1.9 @@ -119,7 +119,7 @@ DEBUGFLAGS=-g # CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only # adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work. -xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \ +xCXXFLAGS=-O2 -std=c++14 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \ $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS) # LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only diff --git a/src/util.cpp b/src/util.cpp index cd5bfc2..a7e50ab 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -995,7 +995,7 @@ static std::string FormatException(std::exception* pex, const char* pszThread) char pszModule[MAX_PATH] = ""; GetModuleFileNameA(NULL, pszModule, sizeof(pszModule)); #else - const char* pszModule = COIN_NAME; + const char* pszModule = COIN_NAME.c_str(); #endif if (pex) return strprintf( @@ -1052,7 +1052,8 @@ boost::filesystem::path GetDefaultDataDir() return pathRet / COIN_NAME_DISPLAY; #else // Unix - return pathRet / "."+ COIN_NAME + ""; + std::string path = "." + COIN_NAME; + return pathRet / path; #endif #endif } @@ -1093,7 +1094,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) boost::filesystem::path GetConfigFile() { - boost::filesystem::path pathConfigFile(GetArg("-conf", ""+ COIN_NAME + ".conf")); + boost::filesystem::path pathConfigFile(GetArg("-conf", std::string("")+ COIN_NAME + ".conf")); if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile; return pathConfigFile; } @@ -1127,7 +1128,7 @@ void ReadConfigFile(map& mapSettingsRet, boost::filesystem::path GetPidFile() { - boost::filesystem::path pathPidFile(GetArg("-pid", ""+ COIN_NAME + "d.pid")); + boost::filesystem::path pathPidFile(GetArg("-pid", std::string("")+ COIN_NAME + "d.pid")); if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile; return pathPidFile; } diff --git a/src/walletdb.h b/src/walletdb.h index 8ae6c3f..9976144 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -5,6 +5,8 @@ #ifndef BITCOIN_WALLETDB_H #define BITCOIN_WALLETDB_H +#define BOOST_NO_CXX11_SCOPED_ENUMS + #include "db.h" #include "base58.h"