From 442d126b036f39f0799ed78bcf44b45408463a2e Mon Sep 17 00:00:00 2001 From: David Sansome Date: Fri, 26 Sep 2014 20:33:02 +1000 Subject: [PATCH] Hack to make the C++11 override keyword work with old compilers. --- CMakeLists.txt | 1 + cmake/C++11Compat.cmake | 9 +++++++++ src/internet/spotifyservice.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 cmake/C++11Compat.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c0b09a48..58091b014 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_policy(SET CMP0011 OLD) include(CheckCXXCompilerFlag) include(FindPkgConfig) +include(cmake/C++11Compat.cmake) include(cmake/Summary.cmake) include(cmake/Version.cmake) include(cmake/Deb.cmake) diff --git a/cmake/C++11Compat.cmake b/cmake/C++11Compat.cmake new file mode 100644 index 000000000..5c4d5151f --- /dev/null +++ b/cmake/C++11Compat.cmake @@ -0,0 +1,9 @@ +# Hacky stuff to make C++11 features work with old compilers. + +if (CMAKE_COMPILER_IS_GNUCC) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GCC_VERSION) + if (GCC_VERSION VERSION_LESS 4.7) + add_definitions(-Doverride=) + endif() +endif() diff --git a/src/internet/spotifyservice.h b/src/internet/spotifyservice.h index 03e43009e..75bbe52ec 100644 --- a/src/internet/spotifyservice.h +++ b/src/internet/spotifyservice.h @@ -56,7 +56,7 @@ class SpotifyService : public InternetService { void ShowContextMenu(const QPoint& global_pos); void ItemDoubleClicked(QStandardItem* item); void DropMimeData(const QMimeData* data, const QModelIndex& index); - QList playlistitem_actions(const Song& song); + QList playlistitem_actions(const Song& song) override; QWidget* HeaderWidget() const; void Logout();