Browse Source

Fix incorrect tag generation for enum classes (#1900)

pull/1888/head
Jelle 5 months ago committed by GitHub
parent
commit
7fd87271ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      src/Generator/Generators/C/CppTypePrinter.cs

3
src/Generator/Generators/C/CppTypePrinter.cs

@ -790,6 +790,7 @@ namespace CppSharp.Generators.C @@ -790,6 +790,7 @@ namespace CppSharp.Generators.C
{
return string.Empty;
}
switch (@class.TagKind)
{
case TagKind.Struct:
@ -801,7 +802,7 @@ namespace CppSharp.Generators.C @@ -801,7 +802,7 @@ namespace CppSharp.Generators.C
case TagKind.Class:
return "class ";
case TagKind.Enum:
return "enum ";
return @class.Enums.First().IsScoped ? "enum class" : "enum ";
default:
throw new ArgumentOutOfRangeException(nameof(@class.TagKind));
}

Loading…
Cancel
Save