Skip to content

Commit

Permalink
fix: restore conditional build without protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
dufkan committed May 10, 2024
1 parent 0daa338 commit 92fbdc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub enum Recipient {
Server,
}

#[cfg(feature = "protocol")]
impl From<protocol::Recipient> for Recipient {
fn from(value: protocol::Recipient) -> Self {
match value {
Expand Down Expand Up @@ -89,10 +90,12 @@ pub unsafe extern "C" fn error_free(error: *mut c_char) {
}

pub struct Protocol {
#[cfg(feature = "protocol")]
instances: Vec<Box<dyn protocol::Protocol>>,
}

impl Protocol {
#[cfg(feature = "protocol")]
fn wrap(instances: Vec<Box<dyn protocol::Protocol>>) -> *mut Self {
Box::into_raw(Box::new(Protocol { instances }))
}
Expand Down

0 comments on commit 92fbdc7

Please sign in to comment.