Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
TY-1793 replace swift dummy call (#100)
Browse files Browse the repository at this point in the history
* remove dummy function

* use ai in swift dummy call
  • Loading branch information
janpetschexain authored and acrrd committed Jun 28, 2021
1 parent 497eaf6 commit 4a78d38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 4 additions & 2 deletions bindings/dart/ios/Classes/SwiftXaynAiFfiDartPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public class SwiftXaynAiFfiDartPlugin: NSObject, FlutterPlugin {

// The Xcode toolchain won't include the shared library in the build
// process unless a method from the library is invoked. So, this
// call is just done to ensure that the library is included.
// call to a component directly related to the ai is just done to ensure
// that the library is included, independent of the actual return value
// or failure.
public func enforceBinding(){
dummy_function()
xaynai_new(nil, nil, nil, nil, nil, nil)
}
}
6 changes: 0 additions & 6 deletions xayn-ai-ffi-c/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ use xayn_ai_ffi::{CCode, Error};
#[cfg(doc)]
pub use crate::slice::CBoxedSlice;

/// This function does nothing.
///
/// Calling this prevents Swift to drop the library.
#[no_mangle]
pub extern "C" fn dummy_function() {}

/// Reads a string slice from the borrowed bytes pointer.
///
/// # Errors
Expand Down

0 comments on commit 4a78d38

Please sign in to comment.