fix up Canvas::Grid child layout
[ardour.git] / libs / pbd / configuration_variable.cc
index 578114e92a55b32e1fcf5e53fedfb3797dab3e9d..0e2d6c739a9392a1ec5f8969fa779749c4f2d2cf 100644 (file)
 #include "pbd/configuration_variable.h"
 #include "pbd/debug.h"
 
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
+// MSVC only introduced std::strtof in VS2013
+#define strtof(s, e) strtod(s, e)
+#endif
+
 using namespace std;
 using namespace PBD;
 
@@ -107,3 +112,10 @@ ConfigVariableBase::miss ()
        // is set but to the same value as it already has
 }
 
+/* Specialisation of ConfigVariable to deal with float (-inf etc)
+ * http://stackoverflow.com/questions/23374095/should-a-stringstream-parse-infinity-as-an-infinite-value
+ */
+template<> void
+ConfigVariable<float>::set_from_string (std::string const & s) {
+       value = std::strtof (s.c_str(), NULL);
+}