summaryrefslogtreecommitdiff
path: root/libbindgen/src/codegen/helpers.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-16 19:43:09 -0600
committerGitHub <noreply@github.com>2016-11-16 19:43:09 -0600
commitb9e15e9fc7f7100aa03256b6997639142ab38e87 (patch)
tree272cd673fca2f27f413b051eba654866b474114d /libbindgen/src/codegen/helpers.rs
parente74acce09bc0f643a0084334f56837bb09f9cf42 (diff)
parent47cb4e34df94480780ea2dc4d7070eb306f1193b (diff)
Auto merge of #273 - upsuper:const-bool, r=emilio
Generate bool value for bool constants This also includes an unrelated commit which ensures newly-added test would be included.
Diffstat (limited to 'libbindgen/src/codegen/helpers.rs')
-rw-r--r--libbindgen/src/codegen/helpers.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/libbindgen/src/codegen/helpers.rs b/libbindgen/src/codegen/helpers.rs
index 8c3d3cea..7284ab80 100644
--- a/libbindgen/src/codegen/helpers.rs
+++ b/libbindgen/src/codegen/helpers.rs
@@ -133,6 +133,10 @@ pub mod ast_ty {
}
}
+ pub fn bool_expr(val: bool) -> P<ast::Expr> {
+ aster::AstBuilder::new().expr().bool(val)
+ }
+
pub fn byte_array_expr(bytes: &[u8]) -> P<ast::Expr> {
let mut vec = Vec::with_capacity(bytes.len() + 1);
for byte in bytes {