Build compat with Windows

main
DaXcess 2022-11-07 15:07:40 +01:00
parent 960f8d89f5
commit d006209857
3 changed files with 9 additions and 8 deletions

View File

@ -0,0 +1,2 @@
[target.x86_64-pc-windows-gnu]
rustflags = "-C link-args=-lssp" # Does does compile without this line

View File

@ -2,6 +2,6 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const MOTD: &str = "OPEN BETA (v2)"; pub const MOTD: &str = "OPEN BETA (v2)";
/// The time it takes for Spoticord to disconnect when no music is being played /// The time it takes for Spoticord to disconnect when no music is being played
pub const DISCONNECT_TIME: u64 = 10; pub const DISCONNECT_TIME: u64 = 5 * 60;
// pub const MOTD: &str = "some good 'ol music"; // pub const MOTD: &str = "some good 'ol music";

View File

@ -97,14 +97,13 @@ async fn main() {
let shard_manager = client.shard_manager.clone(); let shard_manager = client.shard_manager.clone();
let cache = client.cache_and_http.cache.clone(); let cache = client.cache_and_http.cache.clone();
let mut term: Option<Box<dyn Any + Send>>;
#[cfg(unix)] #[cfg(unix)]
{ let mut term: Option<Box<dyn Any + Send>> = Some(Box::new(
term = Some(Box::new( tokio::signal::unix::signal(SignalKind::terminate()).unwrap(),
tokio::signal::unix::signal(SignalKind::terminate()).unwrap(), ));
));
} #[cfg(not(unix))]
let term: Option<Box<dyn Any + Send>> = None;
// Background tasks // Background tasks
tokio::spawn(async move { tokio::spawn(async move {