File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
MetadataProcessor.Shared/Utility
MetadataProcessor.Tests/StubsGenerationTestNFApp Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -191,13 +191,18 @@ internal static string GetNanoCLRTypeName(TypeReference parameterType)
191191 // check if it's generic
192192 return "DATATYPE_GENERICTYPE" ;
193193 }
194- else
194+ else if ( parameterType . IsPointer )
195195 {
196- // this is not a generic, get full qualified type name
197- string typeName = parameterType . FullName . Replace ( "." , String . Empty ) ;
198-
199- return CleanupGenericName ( typeName ) ;
196+ if ( nanoSignaturesTable . PrimitiveTypes . TryGetValue ( parameterType . GetElementType ( ) . FullName , out myType ) )
197+ {
198+ return $ " { myType } ptr" ;
199+ }
200200 }
201+
202+ // last attempt: get full qualified type name
203+ string typeName = parameterType . FullName . Replace ( "." , string . Empty ) ;
204+
205+ return CleanupGenericName ( typeName ) ;
201206 }
202207 }
203208
Original file line number Diff line number Diff line change @@ -27,5 +27,8 @@ public void Method()
2727
2828 [ MethodImpl ( MethodImplOptions . InternalCall ) ]
2929 private static extern byte NativeStaticMethodReturningByte ( char charParam ) ;
30+
31+ [ MethodImpl ( MethodImplOptions . InternalCall ) ]
32+ public extern unsafe void MethodWithPointerParm ( void * pointer , int length ) ;
3033 }
31- }
34+ }
Original file line number Diff line number Diff line change 1515 <RootNamespace >StubsGenerationTestNFApp</RootNamespace >
1616 <AssemblyName >StubsGenerationTestNFApp</AssemblyName >
1717 <TargetFrameworkVersion >v1.0</TargetFrameworkVersion >
18+ <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
1819 </PropertyGroup >
1920 <PropertyGroup Label =" nanoFramework" >
2021 <NFMDP_GENERATE_STUBS >True</NFMDP_GENERATE_STUBS >
3536 <ProjectConfigurationsDeclaredAsItems />
3637 </ProjectCapabilities >
3738 </ProjectExtensions >
38- </Project >
39+ </Project >
You can’t perform that action at this time.
0 commit comments