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