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

TY-1793 replace swift dummy call #100

Merged
merged 2 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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