use platform specifc types for XlibWindow and gbm
this fixes compilation on 32bit targets like armv7
This commit is contained in:
parent
da5c814555
commit
736eb11cd5
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use super::{display::EGLDisplayHandle, ffi, wrap_egl_call, SwapBuffersError};
|
use super::{display::EGLDisplayHandle, ffi, wrap_egl_call, SwapBuffersError};
|
||||||
use nix::libc::{c_int, c_void};
|
use nix::libc::{c_int, c_void};
|
||||||
|
use std::os::raw;
|
||||||
#[cfg(feature = "backend_gbm")]
|
#[cfg(feature = "backend_gbm")]
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::{fmt::Debug, marker::PhantomData, sync::Arc};
|
use std::{fmt::Debug, marker::PhantomData, sync::Arc};
|
||||||
|
@ -226,7 +227,7 @@ pub unsafe trait EGLNativeSurface: Send + Sync {
|
||||||
|
|
||||||
#[cfg(feature = "backend_winit")]
|
#[cfg(feature = "backend_winit")]
|
||||||
/// Typed Xlib window for the `X11` backend
|
/// Typed Xlib window for the `X11` backend
|
||||||
pub struct XlibWindow(pub u64);
|
pub struct XlibWindow(pub raw::c_ulong);
|
||||||
|
|
||||||
#[cfg(feature = "backend_winit")]
|
#[cfg(feature = "backend_winit")]
|
||||||
unsafe impl EGLNativeSurface for XlibWindow {
|
unsafe impl EGLNativeSurface for XlibWindow {
|
||||||
|
@ -241,7 +242,7 @@ unsafe impl EGLNativeSurface for XlibWindow {
|
||||||
ffi::egl::CreatePlatformWindowSurfaceEXT(
|
ffi::egl::CreatePlatformWindowSurfaceEXT(
|
||||||
display.handle,
|
display.handle,
|
||||||
config_id,
|
config_id,
|
||||||
(&mut id) as *mut u64 as *mut _,
|
(&mut id) as *mut raw::c_ulong as *mut _,
|
||||||
surface_attributes.as_ptr(),
|
surface_attributes.as_ptr(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -441,14 +441,14 @@ fn buffer_basic_checks(
|
||||||
if let Ok(size) = ::nix::unistd::lseek(plane.fd.unwrap(), 0, ::nix::unistd::Whence::SeekEnd) {
|
if let Ok(size) = ::nix::unistd::lseek(plane.fd.unwrap(), 0, ::nix::unistd::Whence::SeekEnd) {
|
||||||
// reset the seek point
|
// reset the seek point
|
||||||
let _ = ::nix::unistd::lseek(plane.fd.unwrap(), 0, ::nix::unistd::Whence::SeekSet);
|
let _ = ::nix::unistd::lseek(plane.fd.unwrap(), 0, ::nix::unistd::Whence::SeekSet);
|
||||||
if plane.offset as i64 > size {
|
if plane.offset as libc::off_t > size {
|
||||||
params.as_ref().post_error(
|
params.as_ref().post_error(
|
||||||
ParamError::OutOfBounds as u32,
|
ParamError::OutOfBounds as u32,
|
||||||
format!("Invalid offset {} for plane {}.", plane.offset, plane.plane_idx),
|
format!("Invalid offset {} for plane {}.", plane.offset, plane.plane_idx),
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (plane.offset + plane.stride) as i64 > size {
|
if (plane.offset + plane.stride) as libc::off_t > size {
|
||||||
params.as_ref().post_error(
|
params.as_ref().post_error(
|
||||||
ParamError::OutOfBounds as u32,
|
ParamError::OutOfBounds as u32,
|
||||||
format!("Invalid stride {} for plane {}.", plane.stride, plane.plane_idx),
|
format!("Invalid stride {} for plane {}.", plane.stride, plane.plane_idx),
|
||||||
|
@ -457,7 +457,7 @@ fn buffer_basic_checks(
|
||||||
}
|
}
|
||||||
// Planes > 0 can be subsampled, in which case 'size' will be smaller
|
// Planes > 0 can be subsampled, in which case 'size' will be smaller
|
||||||
// than expected.
|
// than expected.
|
||||||
if plane.plane_idx == 0 && end as i64 > size {
|
if plane.plane_idx == 0 && end as libc::off_t > size {
|
||||||
params.as_ref().post_error(
|
params.as_ref().post_error(
|
||||||
ParamError::OutOfBounds as u32,
|
ParamError::OutOfBounds as u32,
|
||||||
format!(
|
format!(
|
||||||
|
|
Loading…
Reference in New Issue