From 47cb4e34df94480780ea2dc4d7070eb306f1193b Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 17 Nov 2016 11:43:10 +1100 Subject: Generate bool value for bool constants This fixes #272. --- libbindgen/src/codegen/helpers.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libbindgen/src/codegen/helpers.rs') 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 { + aster::AstBuilder::new().expr().bool(val) + } + pub fn byte_array_expr(bytes: &[u8]) -> P { let mut vec = Vec::with_capacity(bytes.len() + 1); for byte in bytes { -- cgit v1.2.3