You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Removal of platform preprocessor blocks in binding definations #14444
Conditionally removing parts (or entire classes) out using the preprocessor. This works grand in legacy, but in NET6 there is a problem:
Since there is one attribute, iOS, we must declare every other one.
Since there is no mac one, and we are in a mac friendly file, the generator adds a mac without a version.
My new attribute test then screams "You said this thing exists on mac but it doesn't, liar!".
In the "modern" binding style we instead use attributes such as [NoiOS] and define tricks like using NSCell=System.Object; instead of defines.
Task
Choose an available framework. Edit this description and post your name next to the framework in question:
Open the primary definition file (appkit.cs for example) and search for #if
If it both:
A platform define we care about in NET6 (MONOMAC, IOS, etc) and NOT NET/!NET/WATCH
The block conditionally compiled contains actual binding interfaces/enums/etc
Then remove the block, apply the relevant availability attribute ([NoiOS], [NoMac], etc) to the attributes.
Once you process the entire file, try compiling src and see what (if anything breaks). You may need to use using tricks if the blocks contains type like UIView or NSView for example.
Due to conditionally compiled types, some rare cases #if can't be removed reasonably. In that case keep it and add [NoiOS], [NoMac], and so on to every member that has an existing type attribute.
Once src builds, run introspection and xtro locally
Check the diff one last time, then, and only then PR the specific framework
Edit this description and post a link to your PR next to the framework in question
Then check the box once the PR lands.
Punchlist
Moved to an internal document due to GH issue issues.
Activity
rolfbjarne commentedon Mar 21, 2022
We should really have xtro working again before merging any of these PRs, since xtro will catch some mistakes.
Remove unnecessary conditional defines from foundation.cs
Remove unnecessary conditional defines from foundation.cs (#14490)
Remove unnecessary conditional defines from gamekit.cs (#14515)
chamons commentedon Apr 4, 2022
All done!