mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 11:15:46 -06:00
fix: cfg on ConsoleInit for windows/emscripten, use simplified cfg for windows/linux
This commit is contained in:
@@ -7,7 +7,7 @@ rustflags = [
|
|||||||
]
|
]
|
||||||
runner = "node"
|
runner = "node"
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")']
|
[target.'cfg(linux)']
|
||||||
rustflags = [
|
rustflags = [
|
||||||
# Manually link zlib.
|
# Manually link zlib.
|
||||||
# The `sdl2` crate's build script uses `libpng`, which requires `zlib`.
|
# The `sdl2` crate's build script uses `libpng`, which requires `zlib`.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ num-width = "0.1.0"
|
|||||||
phf = { version = "0.13.1", features = ["macros"] }
|
phf = { version = "0.13.1", features = ["macros"] }
|
||||||
|
|
||||||
# Windows-specific dependencies
|
# Windows-specific dependencies
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
# Used for customizing console output on Windows; both are required due to the `windows` crate having poor Result handling with `GetStdHandle`.
|
# Used for customizing console output on Windows; both are required due to the `windows` crate having poor Result handling with `GetStdHandle`.
|
||||||
windows = { version = "0.62.0", features = ["Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console"] }
|
windows = { version = "0.62.0", features = ["Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console"] }
|
||||||
windows-sys = { version = "0.61.0", features = ["Win32_System_Console"] }
|
windows-sys = { version = "0.61.0", features = ["Win32_System_Console"] }
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ pub enum AssetError {
|
|||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum PlatformError {
|
pub enum PlatformError {
|
||||||
#[error("Console initialization failed: {0}")]
|
#[error("Console initialization failed: {0}")]
|
||||||
|
#[cfg(any(windows, target_os = "emscripten"))]
|
||||||
ConsoleInit(String),
|
ConsoleInit(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ mod desktop;
|
|||||||
pub use desktop::*;
|
pub use desktop::*;
|
||||||
|
|
||||||
/// Tracing buffer is only used on Windows.
|
/// Tracing buffer is only used on Windows.
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(windows)]
|
||||||
pub mod tracing_buffer;
|
pub mod tracing_buffer;
|
||||||
|
|
||||||
#[cfg(target_os = "emscripten")]
|
#[cfg(target_os = "emscripten")]
|
||||||
|
|||||||
Reference in New Issue
Block a user