Skip to content

Conversation

@IsaacWoods
Copy link
Contributor

At the recommendation of @SimonSapin here, I have revisited the build script to check whether core::ffi::c_void resolves, instead of relying on a particular rustc version. This allows use on 1.30.x builds with core::ffi::c_void.

I also noticed that c_void is defined twice in this crate, once in lib.rs and again in switch.rs. This instead defines c_void for every target except wasm32. As far as I can tell, this shouldn't actually change functionality on any existing targets.

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@SimonSapin
Copy link
Contributor

The use of #![feature] and -Z make this incompatible with release channels other than Nightly. Could they both be replaced by --crate-type lib?

@alexcrichton
Copy link
Member

Thanks for the PR! I would not personally recommend this sort of feature detection though, there's precisely one right answer we know ahead of time for "when is c_void included?" based on versions, so I think we can just amend that here.

Executing rustc -V should be much quicker as well than compiling a program which requires involving a lot more rustc infrastructure.

@IsaacWoods
Copy link
Contributor Author

Okay, I've dropped the first commit with the feature detection. Do you think the de-duplication bit is still worth merging, or should I close this?

@alexcrichton
Copy link
Member

@bors: r+

Nah that's fine, looks good to me!

@bors
Copy link
Contributor

bors commented Oct 4, 2018

📌 Commit 90d8614 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Oct 4, 2018

⌛ Testing commit 90d8614 with merge bd42d06...

bors added a commit that referenced this pull request Oct 4, 2018
Revisit work on cvoid

At the recommendation of @SimonSapin [here](rust-lang/rust#53856 (comment)), I have revisited the build script to check whether `core::ffi::c_void` resolves, instead of relying on a particular `rustc` version. This allows use on `1.30.x` builds with `core::ffi::c_void`.

I also noticed that `c_void` is defined twice in this crate, once in `lib.rs` and again in `switch.rs`. This instead defines `c_void` for every target except `wasm32`. As far as I can tell, this shouldn't actually change functionality on any existing targets.
@bors
Copy link
Contributor

bors commented Oct 4, 2018

💥 Test timed out

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Oct 5, 2018

⌛ Testing commit 90d8614 with merge 57c4a15...

bors added a commit that referenced this pull request Oct 5, 2018
Revisit work on cvoid

At the recommendation of @SimonSapin [here](rust-lang/rust#53856 (comment)), I have revisited the build script to check whether `core::ffi::c_void` resolves, instead of relying on a particular `rustc` version. This allows use on `1.30.x` builds with `core::ffi::c_void`.

I also noticed that `c_void` is defined twice in this crate, once in `lib.rs` and again in `switch.rs`. This instead defines `c_void` for every target except `wasm32`. As far as I can tell, this shouldn't actually change functionality on any existing targets.
@bors
Copy link
Contributor

bors commented Oct 5, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 57c4a15 to master...

@bors bors merged commit 90d8614 into rust-lang:master Oct 5, 2018
@jethrogb jethrogb mentioned this pull request Nov 19, 2018
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.

5 participants