require gcc-4.6 since gcc-4.5.4 produces ICE while compiling bindings.cpp

This commit is contained in:
Andrzej Rybczak
2012-12-14 19:26:54 +01:00
parent 133554bfea
commit b3219f9e34
3 changed files with 28 additions and 17 deletions

View File

@@ -36,7 +36,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]])],
AC_MSG_RESULT([yes])
std_cpp0x="-std=c++0x",
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.5)]])
AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.6)]])
)
CXXFLAGS="$old_CXXFLAGS $std_cpp0x"
@@ -47,7 +47,7 @@ AC_MSG_CHECKING([whether compiler supports initializer lists])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <vector>], [[std::vector<int> test = { 1, 2, 3 }; test.push_back(4);]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support initializer lists, please upgrade (GCC >= 4.5)]])
AC_MSG_ERROR([[Your compiler doesn't seem to support initializer lists, please upgrade (GCC >= 4.6)]])
)
dnl =====================================
@@ -57,7 +57,7 @@ AC_MSG_CHECKING([whether compiler supports auto keyword])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[auto test = new int; *test = 1;]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support auto keyword, please upgrade (GCC >= 4.5)]])
AC_MSG_ERROR([[Your compiler doesn't seem to support auto keyword, please upgrade (GCC >= 4.6)]])
)
dnl =========================================
@@ -67,7 +67,18 @@ AC_MSG_CHECKING([whether compiler supports lambda functions])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[int a = 5; std::function<int(int)> f = [&a](int b) { return a + b; }; f(8);]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support lambda functions, please upgrade (GCC >= 4.5)]])
AC_MSG_ERROR([[Your compiler doesn't seem to support lambda functions, please upgrade (GCC >= 4.6)]])
)
dnl ================================================================
dnl = checking whether calling derived member function of object =
dnl = passed to lambda without explicit 'this' usage works =
dnl ================================================================
AC_MSG_CHECKING([whether calling derived member function passed to lambda without explicit this usage works ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[struct A { void foo() { } }; struct B : public A { void bar() { std::function<void()> f = [this]() { foo(); }; f(); } } foo; foo.bar();]])],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([[Your compiler doesn't seem to support calling derived member function of an object passed to lambda as 'this' without explicit 'this' usage, please upgrade (GCC >= 4.6)]])
)
dnl =========================================

View File

@@ -453,7 +453,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
{
auto tryNextColumn = [this]() -> bool {
bool result = true;
if (this->isActiveWindow(Songs))
if (isActiveWindow(Songs))
{
if (nextColumnAvailable())
nextColumn();
@@ -464,7 +464,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me)
};
auto tryPreviousColumn = [this]() -> bool {
bool result = true;
if (this->isActiveWindow(Tags))
if (isActiveWindow(Tags))
{
if (previousColumnAvailable())
previousColumn();

View File

@@ -25,27 +25,27 @@ namespace MPD {//
std::string MutableSong::getArtist(unsigned idx) const
{
return getTag(MPD_TAG_ARTIST, [this, idx](){ return this->Song::getArtist(idx); }, idx);
return getTag(MPD_TAG_ARTIST, [this, idx](){ return Song::getArtist(idx); }, idx);
}
std::string MutableSong::getTitle(unsigned idx) const
{
return getTag(MPD_TAG_TITLE, [this, idx](){ return this->Song::getTitle(idx); }, idx);
return getTag(MPD_TAG_TITLE, [this, idx](){ return Song::getTitle(idx); }, idx);
}
std::string MutableSong::getAlbum(unsigned idx) const
{
return getTag(MPD_TAG_ALBUM, [this, idx](){ return this->Song::getAlbum(idx); }, idx);
return getTag(MPD_TAG_ALBUM, [this, idx](){ return Song::getAlbum(idx); }, idx);
}
std::string MutableSong::getAlbumArtist(unsigned idx) const
{
return getTag(MPD_TAG_ALBUM_ARTIST, [this, idx](){ return this->Song::getAlbumArtist(idx); }, idx);
return getTag(MPD_TAG_ALBUM_ARTIST, [this, idx](){ return Song::getAlbumArtist(idx); }, idx);
}
std::string MutableSong::getTrack(unsigned idx) const
{
std::string track = getTag(MPD_TAG_TRACK, [this, idx](){ return this->Song::getTrack(idx); }, idx);
std::string track = getTag(MPD_TAG_TRACK, [this, idx](){ return Song::getTrack(idx); }, idx);
if ((track.length() == 1 && track[0] != '0')
|| (track.length() > 3 && track[1] == '/'))
return "0"+track;
@@ -55,32 +55,32 @@ std::string MutableSong::getTrack(unsigned idx) const
std::string MutableSong::getDate(unsigned idx) const
{
return getTag(MPD_TAG_DATE, [this, idx](){ return this->Song::getDate(idx); }, idx);
return getTag(MPD_TAG_DATE, [this, idx](){ return Song::getDate(idx); }, idx);
}
std::string MutableSong::getGenre(unsigned idx) const
{
return getTag(MPD_TAG_GENRE, [this, idx](){ return this->Song::getGenre(idx); }, idx);
return getTag(MPD_TAG_GENRE, [this, idx](){ return Song::getGenre(idx); }, idx);
}
std::string MutableSong::getComposer(unsigned idx) const
{
return getTag(MPD_TAG_COMPOSER, [this, idx](){ return this->Song::getComposer(idx); }, idx);
return getTag(MPD_TAG_COMPOSER, [this, idx](){ return Song::getComposer(idx); }, idx);
}
std::string MutableSong::getPerformer(unsigned idx) const
{
return getTag(MPD_TAG_PERFORMER, [this, idx](){ return this->Song::getPerformer(idx); }, idx);
return getTag(MPD_TAG_PERFORMER, [this, idx](){ return Song::getPerformer(idx); }, idx);
}
std::string MutableSong::getDisc(unsigned idx) const
{
return getTag(MPD_TAG_DISC, [this, idx](){ return this->Song::getDisc(idx); }, idx);
return getTag(MPD_TAG_DISC, [this, idx](){ return Song::getDisc(idx); }, idx);
}
std::string MutableSong::getComment(unsigned idx) const
{
return getTag(MPD_TAG_COMMENT, [this, idx](){ return this->Song::getComment(idx); }, idx);
return getTag(MPD_TAG_COMMENT, [this, idx](){ return Song::getComment(idx); }, idx);
}
void MutableSong::setArtist(const std::string &value, unsigned idx)