Request: Honor `SupportedOSPlatformAttribute` when emitting `.g.c` file.
See original GitHub issueWould be nice if this would work…
public static Exports
{
[SupportedOSPlatform("windows")]
[UnmanagedCallersOnly(EntryPoint = "GetPluginFactory")]
public static IntPtr GetPluginFactory_Win()
{ ... }
[SupportedOSPlatform("linux")]
[UnmanagedCallersOnly(EntryPoint = "GetPluginFactory")]
public static IntPtr GetPluginFactory_Lnx()
{ ... }
Currently (v1.0.23) there is an (C/C++) compiler error that indicates both variations are being emitted in the generated .c file.
Windows error C2084: function 'intptr_t GetPluginFactory(void)' already has a body
Linux error G94CD4D9A: redefinition of 'GetPluginFactory'
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SupportedOSPlatformAttribute Class (System.Runtime. ...
Indicates that an API is supported for a specified platform or operating system. If a version is specified, the API cannot be called...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@obiwanjacobi Published https://www.nuget.org/packages/DNNE/1.0.24
The canonical implementation for the platform attributes is as follows:
The attributes (Supported/UnsupportedOSPlatformAttribute) can each be applied at one of the following levels (generalized for simplicity):
At the highest level that any of the attributes are applied, either
SupportedOSPlatformAttribute
orUnsupportedOSPlatformAttribute
may be applied. This defines an include/exclude list. Any deeper nested level (lower in the list) can applyUnsupportedOSPlatformAttribute
to slim down the cases where the most globalSupportedOSPlatformAttribute
applies, or vice versa. Nested scopes cannot expand the include-list or exclude-list, only slim it down.Here’s a link to the design doc for the attributes: https://github.com/dotnet/designs/blob/main/accepted/2020/platform-exclusion/platform-exclusion.md#design