configure.ac: enable C++14

This commit is contained in:
Max Kellermann
2016-11-18 08:41:47 +01:00
parent b0b8f573bc
commit 2f76f9da89
9 changed files with 607 additions and 152 deletions

View File

@@ -20,19 +20,10 @@
#ifndef MPD_CHRONO_HXX
#define MPD_CHRONO_HXX
#include "Compiler.h"
#include <chrono>
#include <utility>
#include <cstdint>
#if GCC_OLDER_THAN(4,7)
/* std::chrono::duration operators are "constexpr" since gcc 4.7 */
#define chrono_constexpr gcc_pure
#else
#define chrono_constexpr constexpr
#endif
/**
* A time stamp within a song. Granularity is 1 millisecond and the
* maximum value is about 49 days.
@@ -108,11 +99,11 @@ public:
return count() > 0;
}
chrono_constexpr SongTime operator+(const SongTime &other) const {
constexpr SongTime operator+(const SongTime &other) const {
return SongTime(*(const Base *)this + (const Base &)other);
}
chrono_constexpr SongTime operator-(const SongTime &other) const {
constexpr SongTime operator-(const SongTime &other) const {
return SongTime(*(const Base *)this - (const Base &)other);
}
};
@@ -212,15 +203,13 @@ public:
return count() < 0;
}
chrono_constexpr SignedSongTime operator+(const SignedSongTime &other) const {
constexpr SignedSongTime operator+(const SignedSongTime &other) const {
return SignedSongTime(*(const Base *)this + (const Base &)other);
}
chrono_constexpr SignedSongTime operator-(const SignedSongTime &other) const {
constexpr SignedSongTime operator-(const SignedSongTime &other) const {
return SignedSongTime(*(const Base *)this - (const Base &)other);
}
};
#undef chrono_constexpr
#endif