From e6dfdce38a9bfb9559a514fdf6bbb2d17bff67e5 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 11 Jul 2025 22:33:59 -0400 Subject: [PATCH] Fix doctests trying to use the Oodle feature Still not sure what made this break, but now we stop trying to use the real Oodle when compiling doctests. It doesn't make sense there anyway. --- src/packet/oodle.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/packet/oodle.rs b/src/packet/oodle.rs index 83664d6..b35d55f 100644 --- a/src/packet/oodle.rs +++ b/src/packet/oodle.rs @@ -6,7 +6,7 @@ use std::{ffi::c_void, ptr::null}; -#[cfg(feature = "oodle")] +#[cfg(all(not(doc), feature = "oodle"))] #[cfg_attr(windows, link(name = "oodle-network-shared", kind = "raw-dylib"))] #[cfg_attr(not(windows), link(name = "oodle-network-shared"))] unsafe extern "C" { @@ -44,17 +44,17 @@ unsafe extern "C" { } // dummy functions for CI mostly -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1TCP_State_Size() -> isize { panic!("Something is trying to use Oodle but the feature isn't enabled!") } -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1_Shared_Size(htbits: i32) -> isize { panic!("Something is trying to use Oodle but the feature isn't enabled!") } -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1_Shared_SetWindow( shared: *mut c_void, htbits: i32, @@ -64,7 +64,7 @@ pub fn OodleNetwork1_Shared_SetWindow( panic!("Something is trying to use Oodle but the feature isn't enabled!") } -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1TCP_Train( state: *mut c_void, shared: *const c_void, @@ -75,7 +75,7 @@ pub fn OodleNetwork1TCP_Train( panic!("Something is trying to use Oodle but the feature isn't enabled!") } -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1TCP_Decode( state: *mut c_void, shared: *const c_void, @@ -87,7 +87,7 @@ pub fn OodleNetwork1TCP_Decode( panic!("Something is trying to use Oodle but the feature isn't enabled!") } -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1TCP_Encode( state: *mut c_void, shared: *const c_void, @@ -98,7 +98,7 @@ pub fn OodleNetwork1TCP_Encode( panic!("Something is trying to use Oodle but the feature isn't enabled!") } -#[cfg(not(feature = "oodle"))] +#[cfg(any(doc, not(feature = "oodle")))] pub fn OodleNetwork1_CompressedBufferSizeNeeded(rawLen: isize) -> isize { panic!("Something is trying to use Oodle but the feature isn't enabled!") }