Skip to content

Feature: Handle .NET's DllImportAttribute #19

@TIHan

Description

@TIHan

For the dotnet target, we should allow and handle the use of the DllImportAttribute to describe native interop functions.
This should be straight-forward as Oly has a way to describe an attribute as an import attribute which means we do not have provide an implementation for that function.

Thus, when importing DllImportAttribute in the MSIL => OlyIL conversion, we should add a heuristic for DllImportAttribute to be marked as an import attribute. Then, in the emitter we appropriately handle the DllImportAttribute to turn it into a pinvoke method. We already have some code that can do this, we just need to enable it and handle it further.

Note: Consider adding analysis to make sure DllImportAttribute is not mis-used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions