Skip to content

Feature: Handle .NET's DllImportAttribute #19

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions