@@ -153,25 +153,21 @@ private void WrapConstructor(Method method, string wrapper, string @params)
153
153
Context . ParserOptions . IsItaniumLikeAbi ) . Select (
154
154
p => cppTypePrinter . VisitParameter ( p ) ) ) ;
155
155
156
- string @namespace = method . Namespace . Visit ( cppTypePrinter ) ;
157
- Class @class = ( Class ) method . Namespace ;
158
- bool needSubclass = method . Access == AccessSpecifier . Protected || @class . IsAbstract ;
159
- if ( needSubclass )
156
+ if ( method . Access != AccessSpecifier . Protected )
157
+ Write ( "extern \" C\" " ) ;
158
+ Write ( $ "{ GetExporting ( ) } void { wrapper } ({ signature } ) ") ;
159
+
160
+ if ( method . Access == AccessSpecifier . Protected ||
161
+ ( ( Class ) method . Namespace ) . IsAbstract )
160
162
{
161
- Write ( $ "extern \" C\" { GetExporting ( ) } void { wrapper } ({ signature } ) ") ;
162
- WriteLine ( $ "{{ ::new ({ Helpers . InstanceField } ) { wrapper } { method . Namespace . Name } ({ @params } ); }}") ;
163
+ Write ( $@ "{{ ::new ({ Helpers . InstanceField } ) {
164
+ wrapper } { method . Namespace . Name } ({ @params } ); }}" ) ;
165
+ WriteLine ( method . Access == AccessSpecifier . Protected ? " };" : string . Empty ) ;
163
166
}
164
167
else
165
168
{
166
- Write ( "extern \" C\" " ) ;
167
- if ( needSubclass )
168
- Write ( $@ "class { wrapper } { method . Namespace . Namespace . Name } : public {
169
- method . Namespace . Namespace . Visit ( cppTypePrinter ) } {{ " ) ;
170
- Write ( $ "{ GetExporting ( ) } void { wrapper } ({ signature } ) ") ;
171
- Write ( $ "{{ ::new ({ Helpers . InstanceField } ) { @namespace } ({ @params } ); }}") ;
172
- if ( needSubclass )
173
- Write ( "; }" ) ;
174
- NewLine ( ) ;
169
+ string @namespace = method . Namespace . Visit ( cppTypePrinter ) ;
170
+ WriteLine ( $ "{{ ::new ({ Helpers . InstanceField } ) { @namespace } ({ @params } ); }}") ;
175
171
}
176
172
177
173
foreach ( var param in method . Parameters . Where ( p =>
0 commit comments