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,
463463 return PrintLogicalNames ? declaration . LogicalName : declaration . Name ;
464464 }
465465
466+ if ( PrintFlavorKind == CppTypePrintFlavorKind . C )
467+ {
468+ if ( declaration is Function function && function . IsOperator )
469+ return $ "operator_{ function . OperatorKind } ";
470+ }
471+
466472 return PrintLogicalNames ? declaration . LogicalOriginalName
467473 : declaration . OriginalName ;
468474 }
469475 case TypePrintScopeKind . Qualified :
470476 {
477+ var namespaceSep = PrintFlavorKind == CppTypePrintFlavorKind . Cpp ? "::" : "_" ;
478+
471479 if ( ContextKind == TypePrinterContextKind . Managed )
472480 {
473481 var outputNamespace = declaration . TranslationUnit ? . Module ? . OutputNamespace ;
474482 if ( ! string . IsNullOrEmpty ( outputNamespace ) )
475- return $ "{ outputNamespace } ::{ declaration . QualifiedName } ";
483+ {
484+ return $ "{ outputNamespace } { namespaceSep } { declaration . QualifiedName } ";
485+ }
476486
477487 return declaration . QualifiedName ;
478488 }
479489
480490 if ( declaration . Namespace is Class )
481- return $ "{ declaration . Namespace . Visit ( this ) } :: { declaration . OriginalName } ";
491+ return $ "{ declaration . Namespace . Visit ( this ) } { namespaceSep } { GetDeclName ( declaration , TypePrintScopeKind . Local ) } ";
482492
483493 return PrintLogicalNames ? declaration . QualifiedLogicalOriginalName
484494 : declaration . QualifiedOriginalName ;
You can’t perform that action at this time.
0 commit comments