aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-01-12 13:38:21 -0800
committerChris Robinson <[email protected]>2017-01-12 13:38:21 -0800
commit6e806848ebe1c32053aa3bad5603139acce012b3 (patch)
tree5908f3505f05c5be5d964cba49636e94017bd3b2
parent24de5127b1f1d25e507c6c0af5f2272c5baa8490 (diff)
Use C++11 for alsoft-config
-rw-r--r--CMakeLists.txt6
-rw-r--r--utils/alsoft-config/mainwindow.cpp16
2 files changed, 14 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 839bf183..3e608146 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,7 @@ INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckCCompilerFlag)
+INCLUDE(CheckCXXCompilerFlag)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckTypeSize)
include(CheckStructHasMember)
@@ -115,6 +116,11 @@ ELSE()
ENDIF()
ENDIF()
+CHECK_CXX_COMPILER_FLAG(-std=c++11 HAVE_STD_CXX11)
+IF(HAVE_STD_CXX11)
+ SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
+ENDIF()
+
if(NOT WIN32)
# Check if _POSIX_C_SOURCE and _XOPEN_SOURCE needs to be set for POSIX functions
CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN_DEFAULT)
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index e1212f2f..370619bf 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -678,8 +678,8 @@ void MainWindow::loadConfig(const QString &fname)
QStringList disabledCpuExts = settings.value("disable-cpu-exts").toStringList();
if(disabledCpuExts.size() == 1)
disabledCpuExts = disabledCpuExts[0].split(QChar(','));
- std::transform(disabledCpuExts.begin(), disabledCpuExts.end(),
- disabledCpuExts.begin(), std::mem_fun_ref(&QString::trimmed));
+ for(QString &str : disabledCpuExts)
+ str = str.trimmed();
ui->enableSSECheckBox->setChecked(!disabledCpuExts.contains("sse", Qt::CaseInsensitive));
ui->enableSSE2CheckBox->setChecked(!disabledCpuExts.contains("sse2", Qt::CaseInsensitive));
ui->enableSSE3CheckBox->setChecked(!disabledCpuExts.contains("sse3", Qt::CaseInsensitive));
@@ -689,8 +689,8 @@ void MainWindow::loadConfig(const QString &fname)
QStringList hrtf_paths = settings.value("hrtf-paths").toStringList();
if(hrtf_paths.size() == 1)
hrtf_paths = hrtf_paths[0].split(QChar(','));
- std::transform(hrtf_paths.begin(), hrtf_paths.end(),
- hrtf_paths.begin(), std::mem_fun_ref(&QString::trimmed));
+ for(QString &str : hrtf_paths)
+ str = str.trimmed();
if(!hrtf_paths.empty() && !hrtf_paths.back().isEmpty())
ui->defaultHrtfPathsCheckBox->setCheckState(Qt::Unchecked);
else
@@ -745,8 +745,8 @@ void MainWindow::loadConfig(const QString &fname)
{
if(drivers.size() == 1)
drivers = drivers[0].split(QChar(','));
- std::transform(drivers.begin(), drivers.end(),
- drivers.begin(), std::mem_fun_ref(&QString::trimmed));
+ for(QString &str : drivers)
+ str = str.trimmed();
bool lastWasEmpty = false;
foreach(const QString &backend, drivers)
@@ -798,8 +798,8 @@ void MainWindow::loadConfig(const QString &fname)
QStringList excludefx = settings.value("excludefx").toStringList();
if(excludefx.size() == 1)
excludefx = excludefx[0].split(QChar(','));
- std::transform(excludefx.begin(), excludefx.end(),
- excludefx.begin(), std::mem_fun_ref(&QString::trimmed));
+ for(QString &str : excludefx)
+ str = str.trimmed();
ui->enableEaxReverbCheck->setChecked(!excludefx.contains("eaxreverb", Qt::CaseInsensitive));
ui->enableStdReverbCheck->setChecked(!excludefx.contains("reverb", Qt::CaseInsensitive));
ui->enableChorusCheck->setChecked(!excludefx.contains("chorus", Qt::CaseInsensitive));