diff --git a/CMakeLists.txt b/CMakeLists.txt index 37ad9521..4844c5af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -793,7 +793,7 @@ if (WIN32) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-keep-inline-dllexport") endif (WIN32) if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++") else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=gnu++11 -pthread") diff --git a/WSPRBandHopping.cpp b/WSPRBandHopping.cpp index 2bdadb8f..a8ad3118 100644 --- a/WSPRBandHopping.cpp +++ b/WSPRBandHopping.cpp @@ -386,10 +386,11 @@ auto WSPRBandHopping::next_hop (bool tx_enabled) -> Hop #endif { // build new random permutations - m_->rx_permutation_ = target_rx_bands.values (); - std::random_shuffle (std::begin (m_->rx_permutation_), std::end (m_->rx_permutation_)); + std::mt19937 rng(std::time(nullptr)); + m_->rx_permutation_ = target_rx_bands.values (); + std::shuffle (std::begin (m_->rx_permutation_), std::end (m_->rx_permutation_), rng); m_->tx_permutation_ = target_tx_bands.values (); - std::random_shuffle (std::begin (m_->tx_permutation_), std::end (m_->tx_permutation_)); + std::shuffle (std::begin (m_->tx_permutation_), std::end (m_->tx_permutation_), rng); // qDebug () << "New random Rx permutation:" << m_->rx_permutation_ // << "random Tx permutation:" << m_->tx_permutation_; } diff --git a/wsjtx.pro b/wsjtx.pro index 7d36ae4f..300ccde1 100644 --- a/wsjtx.pro +++ b/wsjtx.pro @@ -16,7 +16,7 @@ TARGET = wsjtx VERSION = "Not for Release" TEMPLATE = app DEFINES = QT5 -QMAKE_CXXFLAGS += -std=c++11 +QMAKE_CXXFLAGS += -std=c++17 DEFINES += PROJECT_MANUAL="'\"http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main.html\"'" isEmpty (DESTDIR) {