[Ardour-Dev] Feedback on string-convert branch

John Emmas johne53 at tiscali.co.uk
Tue Jan 10 11:04:22 PST 2017


On 10/01/2017 15:50, John Emmas wrote:
>
>     CONFIG_VARIABLE (uint32_t, osc_port, "osc-port", 3819)
>     CONFIG_VARIABLE (bool, use_osc, "use-osc", false)
>
>     /* editing related */
>
>     CONFIG_VARIABLE (LayerModel, layer_model, "layer-model", Manual)
>
> There's no problem if I comment out all the unusual looking ones 
> (LayerModel / BufferingPreset etc) and just leave the more 
> conventional ones (bool / float etc).  But once I put the other ones 
> back again, I see this weird conflict between 'string_convert.h' and 
> 'rc_configuration_vars.h'.  I haven't got a clue what's going on. Can 
> anyone suggest what might be wrong here??
>

I just found this code in 'pbd/enum_convert.h':-

       #define TO_STRING(Type) \
           template<> inline std::string to_string (Type val) \
           { return enum_2_string (val); }

       #define STRING_TO(Type) \
           template<> inline Type string_to (const std::string& str) \
           { Type val; return (Type) string_2_enum (str, val); }

       #define DEFINE_ENUM_CONVERT(Type) \
           TO_STRING_FULL (Type) \
           STRING_TO_FULL (Type) \
           TO_STRING (Type) \
           STRING_TO (Type)


My guess is that with those specific types (LayerModel / BufferingPreset 
etc) the DEFINE_ENUM_CONVERT macro is somehow getting called with a type 
that's considered invalid (and it therefore ends up at 
T::TO_STRING_TEMPLATE_NOT_DEFINED_FOR_THIS_TYPE).

The affected types (at least, the ones I've looked at so far) appear to 
be enums - so maybe there's some difference in the way VC++ handles 
enums, compared to gcc?  I'm afraid I'm too tired to go any further with 
this tonight but any suggestions would be most welcome!

John


More information about the Ardour-Dev mailing list