diff options
Diffstat (limited to 'common/pybindings.h')
-rw-r--r-- | common/pybindings.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/pybindings.h b/common/pybindings.h index 852fb21f..c4d84442 100644 --- a/common/pybindings.h +++ b/common/pybindings.h @@ -72,6 +72,13 @@ template <> struct string_converter<IdString> inline std::string to_str(Context *ctx, IdString id) { return id.str(ctx); } }; +template <> struct string_converter<const IdString> +{ + inline IdString from_str(Context *ctx, std::string name) { return ctx->id(name); } + + inline std::string to_str(Context *ctx, IdString id) { return id.str(ctx); } +}; + } // namespace PythonConversion NEXTPNR_NAMESPACE_END |