From 2e7e09fd6bbaa8d4b3c04df3fcc19fcac5bcdd38 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 2 Feb 2012 20:21:03 +0100 Subject: [PATCH] ZynAddSubFX: workaround for bug in Win64 GCC When building LMMS with recent stable versions of GCC it generates wrong code for the implicit REALTYPE specialization of the template method stringFrom() (problem in std::stringstream implementation). By writing a custom template specialization which uses sprintf() the bug can be circumvented. --- plugins/zynaddsubfx/src/Misc/Util.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/zynaddsubfx/src/Misc/Util.h b/plugins/zynaddsubfx/src/Misc/Util.h index c0dc73ee2..341bdf546 100644 --- a/plugins/zynaddsubfx/src/Misc/Util.h +++ b/plugins/zynaddsubfx/src/Misc/Util.h @@ -54,6 +54,15 @@ std::string stringFrom(T x) return ss.str(); } +template +std::string stringFrom(REALTYPE x) +{ + char buf[64]; + sprintf( buf, "%f", x ); + return buf; +} + + template T stringTo(const char *x) {