Skip to content

Commit 65d4721

Browse files
committed
Fix C generator GenerateMethodSpecifier to support pure and const specifiers.
1 parent 0c0c4be commit 65d4721

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Generator/Generators/C/CCodeGenerator.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,16 @@ public override void GenerateMethodSpecifier(Method method,
372372

373373
Write(")");
374374

375-
if (method.IsOverride && isDeclaration)
376-
Write(" override");
375+
if (method.IsConst)
376+
Write(" const");
377+
378+
if (isDeclaration)
379+
{
380+
if (method.IsPure)
381+
Write(" = 0");
382+
else if (method.IsOverride)
383+
Write(" override");
384+
}
377385
}
378386

379387
public virtual void GenerateMethodParameters(Function function)

0 commit comments

Comments
 (0)