diff --git a/include/avnd/binding/max/from_atoms.hpp b/include/avnd/binding/max/from_atoms.hpp index ccca8057..8791d327 100644 --- a/include/avnd/binding/max/from_atoms.hpp +++ b/include/avnd/binding/max/from_atoms.hpp @@ -2,7 +2,11 @@ #include #include +#if !defined(__cpp_lib_to_chars) +#include +#else #include +#endif #include #include @@ -35,12 +39,20 @@ struct from_atom if(sym && sym->s_name) { double vv{}; + #if defined(__cpp_lib_to_chars) auto [_, ec] = std::from_chars(sym->s_name, sym->s_name + strlen(sym->s_name), vv); if(ec == std::errc{}) { v = vv; return true; } + #else + if(boost::conversion::try_lexical_convert(str, vv)) + { + v = vv; + return true; + } + #endif } return false; }