Hack to make the C++11 override keyword work with old compilers.

This commit is contained in:
David Sansome 2014-09-26 20:33:02 +10:00
parent 8b19b300b5
commit 442d126b03
3 changed files with 11 additions and 1 deletions

View File

@ -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)

9
cmake/C++11Compat.cmake Normal file
View File

@ -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()

View File

@ -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<QAction*> playlistitem_actions(const Song& song);
QList<QAction*> playlistitem_actions(const Song& song) override;
QWidget* HeaderWidget() const;
void Logout();