make imported functions work

This commit is contained in:
Robin Appelman 2019-04-05 14:24:29 +02:00
commit 56d69458a8
6 changed files with 102 additions and 71 deletions

7
tests/src/imported.rs Normal file
View file

@ -0,0 +1,7 @@
use ivory::externs::printf;
use ivory::ivory_export;
#[ivory_export]
fn imported_fn() {
printf("imported");
}

View file

@ -1,9 +1,12 @@
use std::fmt::Debug;
use crate::imported::imported_fn;
use ivory::externs::printf;
use ivory::PhpVal;
use ivory::{ivory_export, ivory_module};
mod imported;
fn dump<T: Debug>(arg: T) {
printf(format!("{:?}", arg));
}
@ -37,7 +40,6 @@ fn expect_bool(arg: bool) {
fn expect_option_bool(arg: Option<bool>) {
dump(arg);
}
ivory_module!({
name: "tests",
version: "0.0.1",