AaronRobinsonMSFT / DNNE

Prototype native exports for a .NET Assembly.
MIT License
397 stars 41 forks source link

Respect SupportedOSPlatformAttribute on exports. #83

Closed AaronRobinsonMSFT closed 2 years ago

AaronRobinsonMSFT commented 3 years ago

Add tests for all currently defined .NET platforms.

Fixes #82

AaronRobinsonMSFT commented 3 years ago

@jkoritzinsky Could you do me a favor and give this a quick pass? I don't see any need for UnsupportedOSPlatformAttribute for native exporting but could be missing something.

jkoritzinsky commented 2 years ago

This generally looks good. I think implementing the whole spec for these attribute types would be useful, primarily for cases that might use some sort of underlying APIs that only work on some platforms (or to enable the UnmanagedCallersOnly method to use methods with UnsupportedOSPlatformAttribute in managed code and have that reflected properly in the native exports without causing analyzer diagnostics).

I'd suggest doing #ifndef for the "unsupported OS" cases, which should be pretty simple.

AaronRobinsonMSFT commented 2 years ago

I'd suggest doing #ifndef for the "unsupported OS" cases, which should be pretty simple.

Sigh... fine :-) It is simple for sure.

AaronRobinsonMSFT commented 2 years ago

I think implementing the whole spec for these attribute types would be useful

Ugh. This is more complicated since multiple are allowed.... boo.