Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use std::io::IoSlice in libxcb's FFI #285

Merged
merged 1 commit into from
Mar 12, 2020
Merged

Do not use std::io::IoSlice in libxcb's FFI #285

merged 1 commit into from
Mar 12, 2020

Conversation

eduardosm
Copy link
Collaborator

On Windows, xcb defines its own iovec struct in xcb_windefs.h, which does not match the WSABUF struct used in IoSlice.

On Windows, xcb defines its own `iovec` struct in `xcb_windefs.h`, which does not match the `WSABUF` struct used in `IoSlice`.
use libc::{c_char, c_int, c_uint};

// As defined in xcb_windefs.h
#[cfg(not(unix))]
#[derive(Copy, Clone, Debug)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Copy and Clone? std::io::IoSlice only has Debug and Deref.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But iovec from libc has Copy and Clone (but not Debug).

There is a PR to implemente Copy and Clone for std::io::IoSlice.

Anyways we are not using them and the definition is private, so we could remove them.

@psychon
Copy link
Owner

psychon commented Mar 10, 2020

How did you find this? Did this actually break something, or did you just come across this "accidentally"?

@psychon psychon added this to the Post v0.4.1 milestone Mar 10, 2020
@eduardosm
Copy link
Collaborator Author

How did you find this? Did this actually break something, or did you just come across this "accidentally"?

Just accidentally, I didn't have the chance to test x11rb on Windows yet.

@psychon psychon merged commit 4818313 into psychon:master Mar 12, 2020
@eduardosm eduardosm deleted the iovec-windows branch March 12, 2020 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants