-
Notifications
You must be signed in to change notification settings - Fork 745
Add rudimentary support for __float128
#233
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
Conversation
#[test] | ||
fn bindgen_test_layout_A() { | ||
assert_eq!(::std::mem::size_of::<A>() , 16usize); | ||
assert_eq!(::std::mem::align_of::<A>() , 16usize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm.... It seems that this alignment check is failing on Travis CI, but it is working locally. Any ideas, @emilio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt a lot the alignment of f128
is 16
. The same happens with complex types and i128
and friends. Land the test commented with a FIXME and with empty expectations, since there's no way of getting a 128-bit aligned value in rust as of right now.
Also, note that layout tests now don't run by default in regen (probably should be changed? I don't know, makes most of the use cases faster), and you need to run cargo test -p tests_expectations
.
Would it make sense to introduce a fake Rust |
Perhaps! Depends how easy it is to add newtypes to a prelude before the generated bindings are created. I am least familiar with codegen of all of bindgen's phases so far, so I will let @emilio fill in the gaps (and point me in the right direction if we want to do this). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with the constants changed, and the test commented with a FIXME.
I don't think adding a new type for this is necessary given the unlikelyhood of this...
@@ -394,6 +394,7 @@ pub const CXType_ObjCClass: c_uint = 28; | |||
pub const CXType_ObjCSel: c_uint = 29; | |||
pub const CXType_FirstBuiltin: c_uint = 2; | |||
pub const CXType_LastBuiltin: c_uint = 29; | |||
pub const CXType_Float128: c_uint = 30; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this before FirstBuiltin
and make LastBuiltin
30.
#[test] | ||
fn bindgen_test_layout_A() { | ||
assert_eq!(::std::mem::size_of::<A>() , 16usize); | ||
assert_eq!(::std::mem::align_of::<A>() , 16usize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt a lot the alignment of f128
is 16
. The same happens with complex types and i128
and friends. Land the test commented with a FIXME and with empty expectations, since there's no way of getting a 128-bit aligned value in rust as of right now.
Also, note that layout tests now don't run by default in regen (probably should be changed? I don't know, makes most of the use cases faster), and you need to run cargo test -p tests_expectations
.
@emilio fixed per the review comments. |
Well, the LastBuiltin value isn't changed, but we don't use it so I don't think it matters a lot. Thanks for doing this! :) |
@bors-servo r+ |
📌 Commit 5e67ceb has been approved by |
Add rudimentary support for `__float128` This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation. r? @emilio
That is for loops iterating over all types, and is supposed to be the same as |
// | ||
// struct A { | ||
// __float128 f; | ||
// }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have a global constant __float128 gloablaFloat to test it a bit.
This does not generate layout tests, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That struct would generate layout tests, but would fail them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see what you mean, yeah that'd be neat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks.
@bors-servo r- Could you do that @fitzgen? Should be a minute. Also, maybe using two |
@bors-servo delegate+ |
✌️ @fitzgen can now approve this pull request |
I originally had it like this, but decided it wasn't actually any better. |
@bors-servo r=emilio |
📌 Commit 5e67ceb has been approved by |
Bors seems dead, let's try again. |
@bors-servo r+ |
📌 Commit db8dc9a has been approved by |
Add rudimentary support for `__float128` This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation. r? @emilio
💔 Test failed - status-travis |
Looks like |
Hmm... So this still builds fine when Ideally, we would be able to run certain tests only if we are not Therefore, I'm going to comment the whole test out, and add a FIXME comment for when we remove the |
This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation.
@bors-servo r=emilio |
📌 Commit 53f7a50 has been approved by |
Add rudimentary support for `__float128` This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation. r? @emilio
☀️ Test successful - status-travis |
This adds
__float128
as a builtin type, and generates an opaque arrayof 16
u8
s to represent it in the generated bindings since Rust doesn'thave an
f128
type.Context and motivation: Somehow
__float128
is getting pulled intoSpiderMonkey headers from somewhere, and the lack of
__float128
support was causing bindgen to hard fail in bindings generation.
r? @emilio