Main, pcm/SampleFormat, command/Error: remove obsolete GCC version checks
This commit is contained in:
parent
2fb5dbe62b
commit
86a37d0ed6
@ -118,13 +118,7 @@ static constexpr size_t MEGABYTE = 1024 * KILOBYTE;
|
|||||||
|
|
||||||
static constexpr size_t DEFAULT_BUFFER_SIZE = 4 * MEGABYTE;
|
static constexpr size_t DEFAULT_BUFFER_SIZE = 4 * MEGABYTE;
|
||||||
|
|
||||||
static
|
static constexpr
|
||||||
#if GCC_OLDER_THAN(5,0)
|
|
||||||
/* gcc 4.x has no "constexpr" for std::max() */
|
|
||||||
const
|
|
||||||
#else
|
|
||||||
constexpr
|
|
||||||
#endif
|
|
||||||
size_t MIN_BUFFER_SIZE = std::max(CHUNK_SIZE * 32,
|
size_t MIN_BUFFER_SIZE = std::max(CHUNK_SIZE * 32,
|
||||||
64 * KILOBYTE);
|
64 * KILOBYTE);
|
||||||
|
|
||||||
|
@ -29,29 +29,6 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#define GLIBCXX_490 20140422
|
|
||||||
#define GLIBCXX_491 20140716
|
|
||||||
#define GLIBCXX_492 20141030
|
|
||||||
#define GLIBCXX_492_Debian_9 20141220
|
|
||||||
#define GLIBCXX_493 20150626
|
|
||||||
#define GLIBCXX_494 20160803
|
|
||||||
#define GLIBCXX_49X_NDK_r13b 20150123
|
|
||||||
|
|
||||||
/* the big mess attempts to detect whether we're compiling with
|
|
||||||
libstdc++ 4.9.x; __GLIBCXX__ is a date tag and cannot be used to
|
|
||||||
check the major version; and just checking the compiler version
|
|
||||||
isn't enough, because somebody could use an old libstdc++ with
|
|
||||||
clang - SIGH! */
|
|
||||||
#if GCC_OLDER_THAN(5,0) || (defined(__GLIBCXX__) && \
|
|
||||||
(__GLIBCXX__ == GLIBCXX_490 || __GLIBCXX__ == GLIBCXX_491 || \
|
|
||||||
__GLIBCXX__ == GLIBCXX_492 || \
|
|
||||||
__GLIBCXX__ == GLIBCXX_492_Debian_9 || \
|
|
||||||
__GLIBCXX__ == GLIBCXX_493 || \
|
|
||||||
__GLIBCXX__ == GLIBCXX_494 || \
|
|
||||||
__GLIBCXX__ == GLIBCXX_49X_NDK_r13b))
|
|
||||||
#define GLIBCXX_49X
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gcc_const
|
gcc_const
|
||||||
static enum ack
|
static enum ack
|
||||||
ToAck(PlaylistResult result) noexcept
|
ToAck(PlaylistResult result) noexcept
|
||||||
@ -127,19 +104,9 @@ ToAck(std::exception_ptr ep) noexcept
|
|||||||
return ACK_ERROR_ARG;
|
return ACK_ERROR_ARG;
|
||||||
} catch (const std::out_of_range &e) {
|
} catch (const std::out_of_range &e) {
|
||||||
return ACK_ERROR_ARG;
|
return ACK_ERROR_ARG;
|
||||||
#ifdef GLIBCXX_49X
|
|
||||||
} catch (const std::exception &e) {
|
|
||||||
#else
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
#endif
|
|
||||||
try {
|
try {
|
||||||
#ifdef GLIBCXX_49X
|
|
||||||
/* workaround for g++ 4.x: no overload for
|
|
||||||
rethrow_exception(exception_ptr) */
|
|
||||||
std::rethrow_if_nested(e);
|
|
||||||
#else
|
|
||||||
std::rethrow_if_nested(ep);
|
std::rethrow_if_nested(ep);
|
||||||
#endif
|
|
||||||
return ACK_ERROR_UNKNOWN;
|
return ACK_ERROR_UNKNOWN;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return ToAck(std::current_exception());
|
return ToAck(std::current_exception());
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if defined(_WIN32) && GCC_CHECK_VERSION(4,6)
|
#if defined(_WIN32)
|
||||||
/* on WIN32, "FLOAT" is already defined, and this triggers -Wshadow */
|
/* on WIN32, "FLOAT" is already defined, and this triggers -Wshadow */
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
@ -57,17 +57,14 @@ enum class SampleFormat : uint8_t {
|
|||||||
DSD,
|
DSD,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(_WIN32) && GCC_CHECK_VERSION(4,6)
|
#if defined(_WIN32)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the sample format is valid.
|
* Checks whether the sample format is valid.
|
||||||
*/
|
*/
|
||||||
#if !GCC_OLDER_THAN(5,0)
|
constexpr bool
|
||||||
constexpr
|
|
||||||
#endif
|
|
||||||
static inline bool
|
|
||||||
audio_valid_sample_format(SampleFormat format) noexcept
|
audio_valid_sample_format(SampleFormat format) noexcept
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
@ -86,10 +83,7 @@ audio_valid_sample_format(SampleFormat format) noexcept
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !GCC_OLDER_THAN(5,0)
|
constexpr unsigned
|
||||||
constexpr
|
|
||||||
#endif
|
|
||||||
static inline unsigned
|
|
||||||
sample_format_size(SampleFormat format) noexcept
|
sample_format_size(SampleFormat format) noexcept
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
Loading…
Reference in New Issue
Block a user