forked from rust-lang/rust-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#822 - upsuper:mangling-fix, r=emilio
Stop Rust from prepending underscore before '?' for win32 This fixes rust-lang#819. It also includes tests for different platforms which are not supposed to be affected, so that we won't regress them in the future either. The prefix `\x01` char is necessary for Win32. See also [msvc32_symbolify function in regen_atoms.py](https://github.com/servo/servo/blob/1b6d29e31996c87218352b825aa93e01909a6a24/components/style/gecko/regen_atoms.py#L35-L38).
- Loading branch information
Showing
13 changed files
with
165 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
|
||
|
||
extern "C" { | ||
pub fn foo(); | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Default, Copy)] | ||
pub struct Foo { | ||
pub _address: u8, | ||
} | ||
extern "C" { | ||
#[link_name = "_ZN3Foo4sBarE"] | ||
pub static mut Foo_sBar: bool; | ||
} | ||
#[test] | ||
fn bindgen_test_layout_Foo() { | ||
assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! ( | ||
"Size of: " , stringify ! ( Foo ) )); | ||
assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! ( | ||
"Alignment of " , stringify ! ( Foo ) )); | ||
} | ||
impl Clone for Foo { | ||
fn clone(&self) -> Self { *self } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
|
||
|
||
extern "C" { | ||
pub fn foo(); | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Default, Copy)] | ||
pub struct Foo { | ||
pub _address: u8, | ||
} | ||
extern "C" { | ||
#[link_name = "_ZN3Foo4sBarE"] | ||
pub static mut Foo_sBar: bool; | ||
} | ||
#[test] | ||
fn bindgen_test_layout_Foo() { | ||
assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! ( | ||
"Size of: " , stringify ! ( Foo ) )); | ||
assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! ( | ||
"Alignment of " , stringify ! ( Foo ) )); | ||
} | ||
impl Clone for Foo { | ||
fn clone(&self) -> Self { *self } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
|
||
|
||
extern "C" { | ||
pub fn foo(); | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Default, Copy)] | ||
pub struct Foo { | ||
pub _address: u8, | ||
} | ||
extern "C" { | ||
#[link_name = "?sBar@Foo@@2_NA"] | ||
pub static mut Foo_sBar: bool; | ||
} | ||
#[test] | ||
fn bindgen_test_layout_Foo() { | ||
assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! ( | ||
"Size of: " , stringify ! ( Foo ) )); | ||
assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! ( | ||
"Alignment of " , stringify ! ( Foo ) )); | ||
} | ||
impl Clone for Foo { | ||
fn clone(&self) -> Self { *self } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// bindgen-flags: -- --target=i586-unknown-linux | ||
|
||
extern "C" void foo(); | ||
|
||
struct Foo { | ||
static bool sBar; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// bindgen-flags: -- --target=x86_64-unknown-linux | ||
|
||
extern "C" void foo(); | ||
|
||
struct Foo { | ||
static bool sBar; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// bindgen-flags: -- --target=x86_64-apple-darwin | ||
|
||
extern "C" void foo(); | ||
|
||
struct Foo { | ||
static bool sBar; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// bindgen-flags: -- --target=i686-pc-win32 | ||
|
||
extern "C" void foo(); | ||
|
||
struct Foo { | ||
static bool sBar; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// bindgen-flags: -- --target=x86_64-pc-win32 | ||
|
||
extern "C" void foo(); | ||
|
||
struct Foo { | ||
static bool sBar; | ||
}; |