Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support compiling with C++17/C++2a #1747

Merged
merged 1 commit into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)")
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
ENDIF()

if( NOT CPP_STANDARD )
set( CPP_STANDARD "-std=c++11" )
endif()

if( WIN32 )

message( STATUS "Configuring BitShares on WIN32")
Expand Down Expand Up @@ -109,11 +113,11 @@ else( WIN32 ) # Apple AND Linux
if( APPLE )
# Apple Specific Options Here
message( STATUS "Configuring BitShares on OS X" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -stdlib=libc++ -Wall" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CPP_STANDARD} -stdlib=libc++ -Wall" )
else( APPLE )
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CPP_STANDARD} -Wall" )
if(USE_PROFILER)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
endif( USE_PROFILER )
Expand Down
2 changes: 1 addition & 1 deletion libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ namespace graphene { namespace app {
if( start == 0 )
start = stats.total_ops;
else
start = min( stats.total_ops, start );
start = std::min( stats.total_ops, start );

if( start >= stop && start > stats.removed_ops && limit > 0 )
{
Expand Down
4 changes: 3 additions & 1 deletion libraries/app/include/graphene/app/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ namespace graphene { namespace app {
using namespace graphene::market_history;
using namespace graphene::grouped_orders;
using namespace fc::ecc;
using namespace std;
using std::string;
using std::vector;
using std::map;

class application;

Expand Down
4 changes: 3 additions & 1 deletion libraries/app/include/graphene/app/database_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ namespace graphene { namespace app {

using namespace graphene::chain;
using namespace graphene::market_history;
using namespace std;
using std::string;
using std::vector;
using std::map;

class database_api_impl;

Expand Down
3 changes: 2 additions & 1 deletion libraries/wallet/include/graphene/wallet/wallet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
using namespace graphene::app;
using namespace graphene::chain;
using namespace graphene::utilities;
using namespace std;
using std::string;
using std::vector;

namespace fc
{
Expand Down
10 changes: 10 additions & 0 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ namespace fc {

namespace graphene { namespace wallet {

using std::ostream;
using std::stringstream;
using std::to_string;
using std::setprecision;
using std::fixed;
using std::ios;
using std::setiosflags;
using std::setw;
using std::endl;

namespace detail {

struct operation_result_printer
Expand Down
3 changes: 3 additions & 0 deletions tests/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ int sockQuit(void)

#include "../common/genesis_file_util.hpp"

using std::exception;
using std::cerr;

#define INVOKE(test) ((struct test*)this)->test_method();

//////
Expand Down