mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
Fix warnings (#929)
* Fix warnings * Bring back derivatives crate for Windows
This commit is contained in:
@@ -86,6 +86,7 @@ extern crate log;
|
||||
#[macro_use]
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
#[cfg(target_os = "windows")]
|
||||
extern crate derivative;
|
||||
#[macro_use]
|
||||
#[cfg(target_os = "windows")]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use std::{
|
||||
collections::VecDeque, fmt::{self, Debug, Formatter},
|
||||
collections::VecDeque, fmt::{self, Debug},
|
||||
hint::unreachable_unchecked, mem,
|
||||
sync::{atomic::{AtomicBool, Ordering}, Mutex, MutexGuard}, time::Instant,
|
||||
};
|
||||
|
||||
@@ -54,6 +54,7 @@ extern {
|
||||
source: CFRunLoopSourceRef,
|
||||
mode: CFRunLoopMode,
|
||||
);
|
||||
#[allow(dead_code)]
|
||||
pub fn CFRunLoopSourceInvalidate(source: CFRunLoopSourceRef);
|
||||
pub fn CFRunLoopSourceSignal(source: CFRunLoopSourceRef);
|
||||
|
||||
@@ -62,6 +63,7 @@ extern {
|
||||
}
|
||||
|
||||
pub type Boolean = u8;
|
||||
#[allow(dead_code)]
|
||||
const FALSE: Boolean = 0;
|
||||
const TRUE: Boolean = 1;
|
||||
|
||||
@@ -87,9 +89,13 @@ pub type CFRunLoopActivity = CFOptionFlags;
|
||||
pub type CFAbsoluteTime = CFTimeInterval;
|
||||
pub type CFTimeInterval = f64;
|
||||
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const kCFRunLoopEntry: CFRunLoopActivity = 0;
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const kCFRunLoopBeforeWaiting: CFRunLoopActivity = 1 << 5;
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const kCFRunLoopAfterWaiting: CFRunLoopActivity = 1 << 6;
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const kCFRunLoopExit: CFRunLoopActivity = 1 << 7;
|
||||
|
||||
pub type CFRunLoopObserverCallBack = extern "C" fn(
|
||||
@@ -105,6 +111,7 @@ pub type CFRunLoopTimerCallBack = extern "C" fn(
|
||||
pub enum CFRunLoopObserverContext {}
|
||||
pub enum CFRunLoopTimerContext {}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[repr(C)]
|
||||
pub struct CFRunLoopSourceContext {
|
||||
pub version: CFIndex,
|
||||
|
||||
@@ -4,6 +4,7 @@ fn needs_send<T:Send>() {}
|
||||
|
||||
#[test]
|
||||
fn event_loop_proxy_send() {
|
||||
#[allow(dead_code)]
|
||||
fn is_send<T: 'static + Send>() {
|
||||
// ensures that `winit::EventLoopProxy` implements `Send`
|
||||
needs_send::<winit::event_loop::EventLoopProxy<T>>();
|
||||
|
||||
Reference in New Issue
Block a user