Merge pull request #298 from negator/override_dylib

[moor_ffi] Implement overrideForAll and overrideFor
This commit is contained in:
Simon Binder 2019-12-25 13:27:31 +01:00 committed by GitHub
commit c15c4738a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -86,7 +86,9 @@ class OpenDynamicLibrary {
///
/// When using the asynchronous API over isolates, [open] __must be__ a top-
/// level function or a static method.
void overrideFor(OperatingSystem os, OpenLibrary open) {}
void overrideFor(OperatingSystem os, OpenLibrary open) {
_overriddenPlatforms[os] = open;
}
/// Makes `moor_ffi` use the [OpenLibrary] function for all Dart platforms.
/// If this method has been called, it takes precedence over [overrideFor].
@ -94,5 +96,7 @@ class OpenDynamicLibrary {
///
/// When using the asynchronous API over isolates, [open] __must be__ a top-
/// level function or a static method.
void overrideForAll(OpenLibrary open) {}
void overrideForAll(OpenLibrary open) {
_overriddenForAll = open;
}
}