File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -730,7 +730,11 @@ impl ClangSubItemParser for Function {
730730
731731 debug ! ( "Function::parse({cursor:?}, {:?})" , cursor. cur_type( ) ) ;
732732 let visibility = cursor. visibility ( ) ;
733- if visibility != CXVisibility_Default {
733+ let allow_hidden = context. options ( ) . generate_hidden_functions &&
734+ ( visibility == CXVisibility_Hidden ||
735+ visibility == CXVisibility_Protected ) ;
736+
737+ if visibility != CXVisibility_Default && !allow_hidden {
734738 return Err ( ParseError :: Continue ) ;
735739 }
736740 if cursor. access_specifier ( ) == CX_CXXPrivate &&
Original file line number Diff line number Diff line change @@ -2329,4 +2329,16 @@ options! {
23292329 } ,
23302330 as_args: "--generate-private-functions" ,
23312331 } ,
2332+ /// Whether to allow generating functions that are marked with hidden or protected visibility.
2333+ generate_hidden_functions: bool {
2334+ methods: {
2335+ /// Set whether to generate functions that are not externally visible according to clang.
2336+ pub fn generate_hidden_functions( mut self , doit: bool ) -> Self {
2337+ self . options. generate_hidden_functions = doit;
2338+ self
2339+ }
2340+
2341+ } ,
2342+ as_args: "--generate-hidden-functions" ,
2343+ } ,
23322344}
You can’t perform that action at this time.
0 commit comments