Browse Source

Fix incorrect tag generation for enum classes

pull/1900/head
duckdoom5 5 months ago
parent
commit
030e0cf0a2
  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