Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add ffi feature to rockbox-slim for C exports

Gate pcm_squeezelite C exports behind an optional "ffi" feature to
avoid duplicate-symbol linker errors for crates that depend on the
rlib but don't need the C API. Enable the feature in crates/cli so
the final staticlib still provides the symbols for the hosted sink.

+13 -2
+1 -1
crates/cli/Cargo.toml
··· 9 9 [dependencies] 10 10 anyhow = "1.0.90" 11 11 rockbox-airplay = {path = "../airplay"} 12 - rockbox-slim = {path = "../slim"} 12 + rockbox-slim = {path = "../slim", features = ["ffi"]} 13 13 rockbox-upnp = {path = "../upnp", features = ["ffi"]} 14 14 rockbox-chromecast = {path = "../chromecast", features = ["ffi"]} 15 15 clap = "4.5.16"
+3
crates/slim/Cargo.toml
··· 6 6 [lib] 7 7 crate-type = ["rlib"] 8 8 9 + [features] 10 + ffi = [] 11 + 9 12 [dependencies] 10 13 tracing = { workspace = true }
+9 -1
crates/slim/src/lib.rs
··· 234 234 } 235 235 236 236 // --------------------------------------------------------------------------- 237 - // FFI exports 237 + // FFI exports — only compiled when the "ffi" feature is enabled so that 238 + // crates which depend on rockbox-slim without needing the C symbols (e.g. 239 + // rockbox-server) don't produce duplicate-symbol linker errors. 238 240 // --------------------------------------------------------------------------- 239 241 242 + #[cfg(feature = "ffi")] 240 243 #[no_mangle] 241 244 pub extern "C" fn pcm_squeezelite_set_slim_port(port: u16) { 242 245 CONFIG.lock().unwrap().slim_port = port; 243 246 } 244 247 248 + #[cfg(feature = "ffi")] 245 249 #[no_mangle] 246 250 pub extern "C" fn pcm_squeezelite_set_http_port(port: u16) { 247 251 CONFIG.lock().unwrap().http_port = port; 248 252 } 249 253 250 254 /// Start Slim Protocol + HTTP servers. Idempotent. 255 + #[cfg(feature = "ffi")] 251 256 #[no_mangle] 252 257 pub extern "C" fn pcm_squeezelite_start() -> std::os::raw::c_int { 253 258 let mut started = STARTED.lock().unwrap(); ··· 283 288 } 284 289 285 290 /// Push raw S16LE stereo PCM into the broadcast buffer. 291 + #[cfg(feature = "ffi")] 286 292 #[no_mangle] 287 293 pub extern "C" fn pcm_squeezelite_write(data: *const u8, len: usize) -> std::os::raw::c_int { 288 294 if data.is_null() || len == 0 { ··· 294 300 } 295 301 296 302 /// No-op between tracks — all squeezelite clients keep their HTTP connections. 303 + #[cfg(feature = "ffi")] 297 304 #[no_mangle] 298 305 pub extern "C" fn pcm_squeezelite_stop() {} 299 306 300 307 /// Shut down servers (called on daemon exit). 308 + #[cfg(feature = "ffi")] 301 309 #[no_mangle] 302 310 pub extern "C" fn pcm_squeezelite_close() { 303 311 let mut started = STARTED.lock().unwrap();