Skip to content
Open
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
2 changes: 2 additions & 0 deletions bmi-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ license = "MIT"
homepage = "https://github.com/aaraney/bmi-rs"
repository = "https://github.com/aaraney/bmi-rs"

[features]
compat = []

[dependencies]
ffi = { path = "../bmi-rs-sys", package = "bmi-rs-sys", version = "0.0.1" }
20 changes: 14 additions & 6 deletions bmi-rs/src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,13 @@ pub extern "C" fn get_value<T: Bmi>(
BMI_SUCCESS
}

/// See
/// (#3)[https://github.com/aaraney/bmi-rs/issues/3]
/// for why this returns `BMI_FAILURE`.
#[cfg(feature = "compat")]
#[allow(unused_variables)]
pub extern "C" fn get_value_ptr<T: Bmi>(
self_: *mut ffi::Bmi,
name: *const c_char,
dest: *mut *mut c_void,
) -> c_int {
BMI_FAILURE
/*
let var_name = as_str_ref_or_fail!(name);
let data: &mut T = data_field!(&self_);

Expand All @@ -384,7 +380,19 @@ pub extern "C" fn get_value_ptr<T: Bmi>(
};
unsafe { *dest = src };
BMI_SUCCESS
*/
}

/// See
/// (#3)[https://github.com/aaraney/bmi-rs/issues/3]
/// for why this returns `BMI_FAILURE`.
#[cfg(not(feature = "compat"))]
#[allow(unused_variables)]
pub extern "C" fn get_value_ptr<T: Bmi>(
self_: *mut ffi::Bmi,
name: *const c_char,
dest: *mut *mut c_void,
) -> c_int {
BMI_FAILURE
}

pub extern "C" fn get_value_at_indices<T: Bmi>(
Expand Down