From 5ce704e31c2d602ebb415c8d19656ed95d274b57 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 4 Nov 2015 21:01:29 +0100 Subject: [PATCH] add ifdefs to fix conditional compilation --- src/actions.cpp | 6 ++++++ src/actions.h | 4 ++++ src/browser.cpp | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/actions.cpp b/src/actions.cpp index 93deca30..0d6f2bb4 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -2268,12 +2268,18 @@ void SetSelectedItemsPriority::run() bool ToggleOutput::canBeRun() { +#ifdef ENABLE_OUTPUTS return myScreen == myOutputs; +#else + return false; +#endif // ENABLE_OUTPUTS } void ToggleOutput::run() { +#ifdef ENABLE_OUTPUTS myOutputs->toggleOutput(); +#endif // ENABLE_OUTPUTS } bool ToggleVisualizationType::canBeRun() diff --git a/src/actions.h b/src/actions.h index 5d22ecc2..c4354a27 100644 --- a/src/actions.h +++ b/src/actions.h @@ -693,7 +693,9 @@ private: virtual bool canBeRun() OVERRIDE; virtual void run() OVERRIDE; +#ifdef HAVE_TAGLIB_H const MPD::Song *m_song; +#endif // HAVE_TAGLIB_H }; struct EditLibraryTag: BaseAction @@ -788,7 +790,9 @@ private: virtual bool canBeRun() OVERRIDE; virtual void run() OVERRIDE; +#ifdef HAVE_TAGLIB_H const MPD::Song *m_song; +#endif // HAVE_TAGLIB_H }; struct JumpToPositionInSong: BaseAction diff --git a/src/browser.cpp b/src/browser.cpp index 714b5c44..00d1e4d5 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -616,16 +616,16 @@ MPD::Song getLocalSong(const fs::directory_entry &entry, bool read_tags) mpd_song *s = mpd_song_begin(&pair); if (s == nullptr) throw std::runtime_error("invalid path: " + entry.path().native()); -# ifdef HAVE_TAGLIB_H if (read_tags) { +#ifdef HAVE_TAGLIB_H Tags::setAttribute(s, "Last-Modified", timeFormat("%Y-%m-%dT%H:%M:%SZ", fs::last_write_time(entry.path())) ); // read tags Tags::read(s); +#endif // HAVE_TAGLIB_H } -# endif // HAVE_TAGLIB_H return s; }