Commit e22a4fdb authored by Max Kellermann's avatar Max Kellermann

command/Error: improve libstdc++ 4.9.x detection for std::rethrow_if_nested() workaround

parent 29a7b2c5
ver 0.20.6 (not yet released) ver 0.20.6 (not yet released)
* decoder * decoder
- mpcdec: fix crash (division by zero) after seeking - mpcdec: fix crash (division by zero) after seeking
* workaround for GCC 4.9.4 / libstdc++ bug (build failure)
ver 0.20.5 (2017/02/20) ver 0.20.5 (2017/02/20)
* tags * tags
......
...@@ -29,6 +29,29 @@ ...@@ -29,6 +29,29 @@
#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) ToAck(PlaylistResult result)
...@@ -100,13 +123,13 @@ ToAck(std::exception_ptr ep) ...@@ -100,13 +123,13 @@ ToAck(std::exception_ptr ep)
return ACK_ERROR_SYSTEM; return ACK_ERROR_SYSTEM;
} catch (const std::invalid_argument &e) { } catch (const std::invalid_argument &e) {
return ACK_ERROR_ARG; return ACK_ERROR_ARG;
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204 #ifdef GLIBCXX_49X
} catch (const std::exception &e) { } catch (const std::exception &e) {
#else #else
} catch (...) { } catch (...) {
#endif #endif
try { try {
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204 #ifdef GLIBCXX_49X
/* workaround for g++ 4.x: no overload for /* workaround for g++ 4.x: no overload for
rethrow_exception(exception_ptr) */ rethrow_exception(exception_ptr) */
std::rethrow_if_nested(e); std::rethrow_if_nested(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment