File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/Generator/Generators/C Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -463,22 +463,32 @@ public TypePrinterResult GetDeclName(Declaration declaration,
463
463
return PrintLogicalNames ? declaration . LogicalName : declaration . Name ;
464
464
}
465
465
466
+ if ( PrintFlavorKind == CppTypePrintFlavorKind . C )
467
+ {
468
+ if ( declaration is Function function && function . IsOperator )
469
+ return $ "operator_{ function . OperatorKind } ";
470
+ }
471
+
466
472
return PrintLogicalNames ? declaration . LogicalOriginalName
467
473
: declaration . OriginalName ;
468
474
}
469
475
case TypePrintScopeKind . Qualified :
470
476
{
477
+ var namespaceSep = PrintFlavorKind == CppTypePrintFlavorKind . Cpp ? "::" : "_" ;
478
+
471
479
if ( ContextKind == TypePrinterContextKind . Managed )
472
480
{
473
481
var outputNamespace = declaration . TranslationUnit ? . Module ? . OutputNamespace ;
474
482
if ( ! string . IsNullOrEmpty ( outputNamespace ) )
475
- return $ "{ outputNamespace } ::{ declaration . QualifiedName } ";
483
+ {
484
+ return $ "{ outputNamespace } { namespaceSep } { declaration . QualifiedName } ";
485
+ }
476
486
477
487
return declaration . QualifiedName ;
478
488
}
479
489
480
490
if ( declaration . Namespace is Class )
481
- return $ "{ declaration . Namespace . Visit ( this ) } :: { declaration . OriginalName } ";
491
+ return $ "{ declaration . Namespace . Visit ( this ) } { namespaceSep } { GetDeclName ( declaration , TypePrintScopeKind . Local ) } ";
482
492
483
493
return PrintLogicalNames ? declaration . QualifiedLogicalOriginalName
484
494
: declaration . QualifiedOriginalName ;
You can’t perform that action at this time.
0 commit comments