@@ -11,6 +11,7 @@ use ddcommon_ffi::{slice::AsBytes, CharSlice};
1111use  schemars:: JsonSchema ; 
1212use  serde:: { Deserialize ,  Serialize } ; 
1313use  std:: ffi:: c_char; 
14+ 
1415#[ cfg( unix) ]  
1516use  std:: { 
1617    ptr, 
@@ -189,7 +190,7 @@ pub fn is_runtime_callback_registered() -> bool {
189190/// The caller must ensure that no other thread is calling `clear_runtime_callback` 
190191/// or registration functions concurrently, as those could invalidate 
191192/// the pointer between the null check and dereferencing. 
192- #[ cfg( unix) ]  
193+ #[ cfg( all ( unix,  feature =  "collector" ) ) ]  
193194pub ( crate )  unsafe  fn  get_registered_callback_type_internal ( )  -> Option < & ' static  str >  { 
194195    let  callback_ptr = RUNTIME_CALLBACK . load ( Ordering :: SeqCst ) ; 
195196    if  callback_ptr. is_null ( )  { 
@@ -264,7 +265,7 @@ pub unsafe fn clear_runtime_callback() {
264265/// - No other thread is calling `clear_runtime_callback` concurrently 
265266/// - The registered callback function is signal-safe 
266267/// - The writer parameter remains valid for the duration of the call 
267- #[ cfg( unix) ]  
268+ #[ cfg( all ( unix,  feature =  "collector" ) ) ]  
268269pub ( crate )  unsafe  fn  invoke_runtime_callback_with_writer < W :  std:: io:: Write > ( 
269270    writer :  & mut  W , 
270271)  -> Result < ( ) ,  std:: io:: Error >  { 
@@ -368,7 +369,7 @@ pub(crate) unsafe fn invoke_runtime_callback_with_writer<W: std::io::Write>(
368369/// The caller must ensure that `frame` is either null or points to a valid, properly 
369370/// initialized RuntimeStackFrame. All C string pointers within the frame must be either 
370371/// null or point to valid, null-terminated C strings. 
371- #[ cfg( unix) ]  
372+ #[ cfg( all ( unix,  feature =  "collector" ) ) ]  
372373unsafe  fn  emit_frame_as_json ( 
373374    writer :  & mut  dyn  std:: io:: Write , 
374375    frame :  * const  RuntimeStackFrame , 
@@ -421,7 +422,7 @@ unsafe fn emit_frame_as_json(
421422    Ok ( ( ) ) 
422423} 
423424
424- #[ cfg( all ( test,  unix ) ) ]  
425+ #[ cfg( test) ]  
425426mod  tests { 
426427    use  super :: * ; 
427428    use  std:: ffi:: CString ; 
0 commit comments