File tree Expand file tree Collapse file tree
sources/SilkTouch/SilkTouch/Mods Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,10 @@ private class Rewriter(Configuration config) : CSharpSyntaxRewriter
6666 // Transform bool-like fields to use MaybeBool
6767 var nativeType =
6868 node . AttributeLists . GetNativeTypeName ( ) ?? node . Declaration . Type . ToString ( ) ;
69- if ( config . BoolTypes . TryGetValue ( nativeType , out var scheme ) )
69+ if (
70+ config . BoolTypes . TryGetValue ( nativeType , out var scheme )
71+ || ( nativeType == "bool" && node . Declaration . Type . ToString ( ) . Trim ( ) != "bool" ) // stdbool.h, hopefully...
72+ )
7073 {
7174 var newType = string . IsNullOrWhiteSpace ( scheme )
7275 ? GenericName (
@@ -94,7 +97,10 @@ private class Rewriter(Configuration config) : CSharpSyntaxRewriter
9497 {
9598 // Transform bool-like properties to use MaybeBool
9699 var nativeType = node . AttributeLists . GetNativeTypeName ( ) ?? node . Type . ToString ( ) ;
97- if ( config . BoolTypes . TryGetValue ( nativeType , out var scheme ) )
100+ if (
101+ config . BoolTypes . TryGetValue ( nativeType , out var scheme )
102+ || ( nativeType == "bool" && node . Type . ToString ( ) . Trim ( ) != "bool" ) // stdbool.h, hopefully...
103+ )
98104 {
99105 var newType = string . IsNullOrWhiteSpace ( scheme )
100106 ? GenericName (
You can’t perform that action at this time.
0 commit comments