Replace gnc_make_option<SCM> with gnc_make_scm_option

To finesse SWIG_Guile's typedef unsigned long SCM, which causes SFINAE
issues when trying to resolve the template.
This commit is contained in:
John Ralls 2021-03-02 14:24:15 -08:00
parent e7309f077b
commit c04f4a00e0
2 changed files with 15 additions and 0 deletions

View File

@ -517,6 +517,16 @@ GncOption::from_scheme(std::istream& iss)
}, *m_option);
}
GncOption*
gnc_make_SCM_option(const char* section, const char* name,
const char* key, const char* doc_string,
SCM value, GncOptionUIType ui_type)
{
return new GncOption(section, name, key, doc_string,
reinterpret_cast<SCM>(value), ui_type);
}
/* We must instantiate all of the templates we need here because we don't expose
* the template implementation in the public header.
*/

View File

@ -150,4 +150,9 @@ gnc_make_option(const char* section, const char* name,
return new GncOption(section, name, key, doc_string, value, ui_type);
}
/* To work around SWIG_Guile's typedef of SCM to unsigned long: */
GncOption* gnc_make_SCM_option(const char* section, const char* name,
const char* key, const char* doc_string,
SCM value, GncOptionUIType ui_type);
#endif //GNC_OPTION_HPP_