Do build-time bindgen

Majority of build_gecko.rs is just the straightforward conversion from
regen.py. There are two differences that:
1. Side in whitelist is changed to mozilla::Side
2. std::atomic__My_base is added to opaque types for Windows
This commit is contained in:
Xidorn Quan 2016-12-09 13:55:49 -10:00
parent 6dd4b4822f
commit 1cefd1bef0
8 changed files with 739 additions and 835 deletions

View file

@ -3,22 +3,23 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#[allow(dead_code, improper_ctypes, non_camel_case_types)]
pub mod bindings;
pub mod bindings {
include!(concat!(env!("OUT_DIR"), "/gecko/bindings.rs"));
}
// FIXME: We allow `improper_ctypes` (for now), because the lint doesn't allow
// foreign structs to have `PhantomData`. We should remove this once the lint
// ignores this case.
#[cfg(debug_assertions)]
#[allow(dead_code, improper_ctypes, non_camel_case_types, non_snake_case, non_upper_case_globals)]
pub mod structs {
include!("structs_debug.rs");
}
#[cfg(not(debug_assertions))]
#[allow(dead_code, improper_ctypes, non_camel_case_types, non_snake_case, non_upper_case_globals)]
pub mod structs {
include!("structs_release.rs");
cfg_if! {
if #[cfg(debug_assertions)] {
include!(concat!(env!("OUT_DIR"), "/gecko/structs_debug.rs"));
} else {
include!(concat!(env!("OUT_DIR"), "/gecko/structs_release.rs"));
}
}
}
pub mod sugar;