Remove libc dependency on non-linux platforms (#1976)

This commit is contained in:
Markus Røyset 2021-07-13 17:27:47 +02:00 committed by GitHub
parent 5a65347c4e
commit 8c91986dd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View file

@ -3,7 +3,6 @@
use std::os::raw::c_void;
use std::path::Path;
use libc;
use winapi::shared::minwindef::WORD;
use winapi::shared::windef::{HMENU, HWND};
@ -72,11 +71,11 @@ impl<T> EventLoopExtWindows for EventLoop<T> {
/// Additional methods on `Window` that are specific to Windows.
pub trait WindowExtWindows {
/// Returns the HINSTANCE of the window
fn hinstance(&self) -> *mut libc::c_void;
fn hinstance(&self) -> *mut c_void;
/// Returns the native handle that is used by this window.
///
/// The pointer will become invalid when the native window was destroyed.
fn hwnd(&self) -> *mut libc::c_void;
fn hwnd(&self) -> *mut c_void;
/// Enables or disables mouse and keyboard input to the specified window.
///
@ -102,12 +101,12 @@ pub trait WindowExtWindows {
impl WindowExtWindows for Window {
#[inline]
fn hinstance(&self) -> *mut libc::c_void {
fn hinstance(&self) -> *mut c_void {
self.window.hinstance() as *mut _
}
#[inline]
fn hwnd(&self) -> *mut libc::c_void {
fn hwnd(&self) -> *mut c_void {
self.window.hwnd() as *mut _
}

View file

@ -2,6 +2,8 @@
#![allow(dead_code, non_snake_case, non_upper_case_globals)]
use std::ffi::c_void;
use cocoa::{
base::id,
foundation::{NSInteger, NSUInteger},
@ -159,7 +161,7 @@ pub const IOYUV422Pixels: &str = "Y4U2V2";
pub const IO8BitOverlayPixels: &str = "O8";
pub type CGWindowLevel = i32;
pub type CGDisplayModeRef = *mut libc::c_void;
pub type CGDisplayModeRef = *mut c_void;
#[cfg_attr(
not(use_colorsync_cgdisplaycreateuuidfromdisplayid),