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

Fix compilation for 32 bit targets #665

Merged
merged 1 commit into from
Nov 30, 2015

Conversation

antrik
Copy link
Contributor

@antrik antrik commented Nov 30, 2015

Regression introduced in 47df0e9

Casting fullscreen_atom (which is the result from XInternAtom, i.e.
c_ulong) as i64 is obviously wrong -- the whole point of types such as
c_ulong is that long in C does not always have the same bit size...

Cast it as c_long instead.

While this is the most straightforward fix, I'm not sure it's the best
one: perhaps the x11 crate should offer a set_ulong() method along with
set_long(), which could be used here instead of the cast?

@@ -535,11 +535,13 @@ impl Window {
message_type: state_atom, // the _NET_WM_STATE atom is sent to change the state of a window
format: 32, // view `data` as `c_long`s
data: {
use std::os::raw::c_long;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move that line to the top of the module.

Regression introduced in 47df0e9

Casting fullscreen_atom (which is the result from XInternAtom, i.e.
c_ulong) as i64 is obviously wrong -- the whole point of types such as
c_ulong is that long in C does *not* always have the same bit size...

Cast it as c_long instead.

While this is the most straightforward fix, I'm not sure it's the best
one: perhaps the x11 crate should offer a set_ulong() method along with
set_long(), which could be used here instead of the cast?
@antrik
Copy link
Contributor Author

antrik commented Nov 30, 2015

I pushed an updated patch. Is it fine now?

@tomaka
Copy link
Contributor

tomaka commented Nov 30, 2015

Thanks!

tomaka added a commit that referenced this pull request Nov 30, 2015
@tomaka tomaka merged commit 5b819ed into rust-windowing:master Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants