Skip to content

Commit

Permalink
Move cfgs in platform module
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Aug 11, 2022
1 parent b1c9e4a commit 302a05e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
2 changes: 0 additions & 2 deletions src/platform/android.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(any(target_os = "android"))]

use crate::{
event_loop::{EventLoop, EventLoopWindowTarget},
window::{Window, WindowBuilder},
Expand Down
2 changes: 0 additions & 2 deletions src/platform/ios.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(target_os = "ios")]

use std::os::raw::c_void;

use crate::{
Expand Down
2 changes: 0 additions & 2 deletions src/platform/macos.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(target_os = "macos")]

use std::os::raw::c_void;

use crate::{
Expand Down
22 changes: 22 additions & 0 deletions src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,33 @@
//!
//! However only the module corresponding to the platform you're compiling to will be available.

#[cfg(target_os = "android")]
pub mod android;
#[cfg(target_os = "ios")]
pub mod ios;
#[cfg(target_os = "macos")]
pub mod macos;
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
pub mod unix;
#[cfg(target_arch = "wasm32")]
pub mod web;
#[cfg(target_os = "windows")]
pub mod windows;

#[cfg(any(
target_os = "windows",
target_os = "macos",
target_os = "android",
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
pub mod run_return;
11 changes: 0 additions & 11 deletions src/platform/run_return.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
#![cfg(any(
target_os = "windows",
target_os = "macos",
target_os = "android",
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]

use crate::{
event::Event,
event_loop::{ControlFlow, EventLoop, EventLoopWindowTarget},
Expand Down
8 changes: 0 additions & 8 deletions src/platform/unix.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]

use std::os::raw;
#[cfg(feature = "x11")]
use std::{ptr, sync::Arc};
Expand Down
2 changes: 0 additions & 2 deletions src/platform/web.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(target_arch = "wasm32")]

//! The web target does not automatically insert the canvas element object into the web page, to
//! allow end users to determine how the page should be laid out. Use the [`WindowExtWebSys`] trait
//! to retrieve the canvas from the Window. Alternatively, use the [`WindowBuilderExtWebSys`] trait
Expand Down
2 changes: 0 additions & 2 deletions src/platform/windows.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(target_os = "windows")]

use std::{ffi::c_void, path::Path};

use crate::{
Expand Down

0 comments on commit 302a05e

Please sign in to comment.