Fixed some warnings when building on Windows

This commit is contained in:
Osspial 2016-05-07 21:05:45 -04:00
parent 163563073f
commit b2cf70b342
3 changed files with 5 additions and 8 deletions

View file

@ -6,7 +6,6 @@ use std::sync::{Arc, Mutex};
use std::ffi::OsString; use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt; use std::os::windows::ffi::OsStringExt;
use WindowAttributes;
use CursorState; use CursorState;
use Event; use Event;
use super::event; use super::event;
@ -28,6 +27,10 @@ pub struct ThreadLocalData {
pub mouse_in_window: bool pub mouse_in_window: bool
} }
/// Equivalent to the windows api [MINMAXINFO](https://msdn.microsoft.com/en-us/library/windows/desktop/ms632605%28v=vs.85%29.aspx)
/// struct. Used because winapi-rs doesn't have this declared.
#[repr(C)]
#[allow(dead_code)]
struct MinMaxInfo { struct MinMaxInfo {
reserved: winapi::POINT, // Do not use/change reserved: winapi::POINT, // Do not use/change
max_size: winapi::POINT, max_size: winapi::POINT,
@ -342,7 +345,7 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
}, },
winapi::WM_GETMINMAXINFO => { winapi::WM_GETMINMAXINFO => {
let mut mmi = lparam as *mut MinMaxInfo; let mmi = lparam as *mut MinMaxInfo;
//(*mmi).max_position = winapi::POINT { x: -8, y: -8 }; // The upper left corner of the window if it were maximized on the primary monitor. //(*mmi).max_position = winapi::POINT { x: -8, y: -8 }; // The upper left corner of the window if it were maximized on the primary monitor.
//(*mmi).max_size = winapi::POINT { x: .., y: .. }; // The dimensions of the primary monitor. //(*mmi).max_size = winapi::POINT { x: .., y: .. }; // The dimensions of the primary monitor.

View file

@ -65,10 +65,6 @@ pub use window::{WindowBuilder, WindowProxy, PollEventsIterator, WaitEventsItera
pub use window::{AvailableMonitorsIter, MonitorId, get_available_monitors, get_primary_monitor}; pub use window::{AvailableMonitorsIter, MonitorId, get_available_monitors, get_primary_monitor};
pub use native_monitor::NativeMonitorId; pub use native_monitor::NativeMonitorId;
use std::io;
#[cfg(not(target_os = "macos"))]
use std::cmp::Ordering;
mod api; mod api;
mod platform; mod platform;
mod events; mod events;

View file

@ -7,9 +7,7 @@ pub use api::win32::{WindowProxy, PollEventsIterator, WaitEventsIterator};
use CreationError; use CreationError;
use WindowAttributes; use WindowAttributes;
use std::ffi::CString;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use kernel32;
#[derive(Default)] #[derive(Default)]
pub struct PlatformSpecificWindowBuilderAttributes; pub struct PlatformSpecificWindowBuilderAttributes;