diff --git a/Cargo.lock b/Cargo.lock index 57cb945169..86e8e96a26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -624,6 +624,7 @@ name = "wgpu-native" version = "0.4.0" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "wgpu-core 0.1.0", diff --git a/wgpu-native/Cargo.toml b/wgpu-native/Cargo.toml index dc66ec014a..d1f6e01294 100644 --- a/wgpu-native/Cargo.toml +++ b/wgpu-native/Cargo.toml @@ -29,3 +29,5 @@ version = "0.1" lazy_static = "1.1" parking_lot = "0.9" raw-window-handle = "0.3" +libc = {version="0.2", features=[]} + diff --git a/wgpu-native/src/device.rs b/wgpu-native/src/device.rs index 7180d3ada1..32553b1fb3 100644 --- a/wgpu-native/src/device.rs +++ b/wgpu-native/src/device.rs @@ -8,6 +8,8 @@ use core::{gfx_select, hub::Token, id}; use std::{marker::PhantomData, slice}; +use libc::{c_ulong}; + pub type RequestAdapterCallback = unsafe extern "C" fn(id: id::AdapterId, userdata: *mut std::ffi::c_void); pub type BufferMapReadCallback = @@ -78,7 +80,7 @@ pub fn wgpu_create_surface(raw_handle: raw_window_handle::RawWindowHandle) -> id #[no_mangle] pub extern "C" fn wgpu_create_surface_from_xlib( display: *mut *const std::ffi::c_void, - window: u64, + window: c_ulong, ) -> id::SurfaceId { use raw_window_handle::unix::XlibHandle; wgpu_create_surface(raw_window_handle::RawWindowHandle::Xlib(XlibHandle {