Skip to content

Commit

Permalink
Merge pull request #47 from stefunctional/main
Browse files Browse the repository at this point in the history
Forward-declare non-flat uniffi enums
  • Loading branch information
Lipt0nas authored Sep 27, 2024
2 parents 1521029 + 736d659 commit 6902e78
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bindgen/src/bindings/cpp/templates/wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ namespace {{ namespace }} {
{%- match typ %}
{%- when Type::Enum { module_path, name } %}
{%- let e = ci|get_enum_definition(name) %}
{%- if ci.is_name_used_as_error(name) %}
{%- if ci.is_name_used_as_error(name) || !e.is_flat() %}
struct {{ name }};
{%- else %}
{%- if e.is_flat() %}
enum class {{ name }};
{%- endif %}
{%- endif %}
{%- when Type::Record { module_path, name } %}
{%- when Type::Record { module_path, name } %}
struct {{ name }};
{%- when Type::Object { module_path, name, imp } %}
struct {{ name }};
Expand Down

0 comments on commit 6902e78

Please sign in to comment.