This property has also been added on macOS (where it didn't exist before), since
both documentation and headers reveal it's available there.
Also make the property nullable for macOS and XAMCORE_5_0.
The iOS code uses the NSDefaultAttributesDocumentAttribute key, while the macOS code
uses the NSDefaultAttributesDocumentOption key, but according to Apple's documentation
these keys have the same underlying string value, so just use NSDefaultAttributesDocumentAttribute
for all platforms to simplify code.
The iOS code uses the NSDocumentTypeDocumentAttribute key, while the macOS code uses
the NSDocumentTypeDocumentOption key, but according to Apple's documentation these
keys have the same underlying string value, so just use NSDocumentTypeDocumentAttribute
for all platforms to simplify code.
The iOS code uses the NSDocumentTypeDocumentAttribute key, while the macOS code uses
the NSDocumentTypeDocumentOption key, but according to Apple's documentation these
keys have the same underlying string value, so just use NSDocumentTypeDocumentAttribute
for all platforms to simplify code.
The iOS code uses the NSCharacterEncodingDocumentAttribute key, while the macOS code
uses the NSCharacterEncodingDocumentOption key, but according to Apple's documentation
these keys have the same underlying string value, so just use NSCharacterEncodingDocumentAttribute
for all platforms to simplify code.
Modified the FindWatchOS2AppBundleTaskBase and Xamarin.iOS.Common.targets so that it only tries to copy the WatchKit stub into the IPA file if the watch app bundle includes the folder.
This should fix the error that was found in #10070 by @ivanicin
Backport of #17004
Co-authored-by: Jack Butler <jbutler@glneurotech.com>
Co-authored-by: Jack Aardal <jaardal@glneurotech.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
* Call _SetUpdatedSnapshotHandler from the (NativeHandle, bool) constructor,
this way it's called from all constructors.
* Call the (NativeHandle, bool) constructor from all other constructors to
ensure a consistent instance.
* Remove the internal (IntPtr) constructor, it's no longer used. This also
fixes a memory leak, because the (IntPtr) constructor would just create a
new nw_path_monitor instance instead of using the passed-in handle
(effectively forgetting about it and leaking it).
Cache the AOT compiler path, to avoid an expensive recomputation on every
build. This is even more expensive when building remotely from Windows, so
store the cached value on Windows.
Fixes https://github.com/xamarin/xamarin-macios/issues/16774.
This is the first in a series or changes for making pinvokes that take
strings contain all blitable types.
NativeString.cs is being used to do the conversion. Be aware that we're
abusing `IDisposable` to act like C++'s RAII, but it makes the usage
cleaner.
* Improve these methods to find members inside nested types as well.
* Simplify their implementation somewhat.
* Make the filter method optional to allow enumerating everything.
* Rename these methods to Enumerate* to better express what they do.
* Make them extension methods on AssemblyDefinition to make them more
discoverable and easier to use.
Improve perf in cecil-tests by caching loaded assemblies, and thus only
loading them once. The gain isn't all that much - it saves about 3s of ~2m on
my machine, so ~1.5% faster - but it'll be more and more important as we write
more tests. Also the code becomes slightly simpler too.
Closes#16979
The only `MidiPacket` constructor ever used internally is the one accepting an `IntPtr` argument. Therefore `bytes` will always have the default empty array value. Because of this, in the `Bytes` get accessor `bytes` is not null, but empty and indexing into `bytes` on line 848 throws the exception. The other option would have been to remove the empty array default value that was added in #15098, but the length check seemed like the safer, although maybe slightly less performant, option.
NSObject_Disposer.Drain isn't reentry-safe, and there's a rather impressive
(and not in a good way) case where this can happen: if a native dealloc method
ends up processing the main thread's runloop somehow.
The fix makes the Drain function detect reentrancy, and just re-schedule a
call to itself on the run loop. I believe should be safe - either the dealloc
method will process the runloop again a few times, in which case we'll just
re-schedule the drain call every time, until the dealloc method finishes
processing the runloop, and then the next drain call will actually drain.
Fixes https://github.com/xamarin/xamarin-macios/issues/16587.
The automatic translation apparently runs on windows, creates files with crlf,
and will check in the corresponding files as such. During the local build
these files will be read and written out again, but now with lf endings,
leaving all these files modified.
So set the 'text' git attribute for these files, so that they're stored as
'lf' and converted to 'crlf' on Windows.
Don't put availability attributes inside a platform condition, because we need
all availability attributes to be visible when building all platforms,
otherwise we won't generate the correct attributes for other platforms.
Improve performance in Cecil.Tests.GenericPInvokesTest by creating fewer
strings.
This saves about 1m07s seconds on my machine, from 2m10s to 1m03s, so ~52%
faster.
* There's no such thing as Mac Catalyst 8.0. This is probably copied from iOS 8.0,
which is supported in all versions of Mac Catalyst, so just remove the version
for the corresponding SupportedOSPlatform attributes.
* Remove the version in SupportedOSPlatform attributes when the version is equal
to or lower than the min OS version we support for the given platform.
* Remove UnsupportedOSPlatform attributes when there's an identical ObsoletedOSPlatform
attribute.
* Remove UnsupportedOSPlatform attributes when it's a blatent lie, because the
API is available (in Security/Certificate.cs).
* There's no such thing as Mac Catalyst 10.13. It looks like this was a typo, meant
to be Mac Catalyst 13.0.
The BackingFieldDelayHandler will temporarily remove the body of Dispose
methods, and then for every field accessed in the Dispose method that was
preserved by the linker, we'll keep the corresponding code in the Dispose
method (otherwise we'd remove the code).
This is a way to remove fields that are _only_ accessed (and nulled out) in
the Dispose method.
However, we were running into a problem with determining if a field was marked
by the linker: if the field is in a generic type, and that field was not
marked by the linker, the linker might have actually removed the field from
the containing type before we're processing the Dispose methods, and we'd find
a null field definition where no null field definition was expected
(eventually resulting in an ArgumentNullException).
Fix this by treating a null field definition as an unmarked field.
Also add a test.
Fixes https://github.com/xamarin/xamarin-macios/issues/16957.
This allows us to unify the code between all platforms.
Also add all the NSAttributedStringDocumentAttributeKey values we haven't bound yet.
There are no changes in the public API, because I'm only changing internal types.
Ref: #14489.