summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-03-20 14:37:41 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-03-20 14:37:41 +0100
commitb4f103bc91fa73f355fc183d79100f23bfd96c6b (patch)
treee920b6eff601bd80b409ddd3f7b4a23c9e834fad /src/lib.rs
parent15a18fa820d1b9d7e97bd317eb210d0363f95ee3 (diff)
options: Allow force-generating inline functions.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index e92be92b..433198b0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -415,6 +415,16 @@ impl Builder {
self
}
+ /// Whether inline functions should be generated or not.
+ ///
+ /// Note that they will usually not work. However you can use
+ /// `-fkeep-inline-functions` or `-fno-inline-functions` if you are
+ /// responsible of compiling the library to make them callable.
+ pub fn generate_inline_functions(mut self, doit: bool) -> Self {
+ self.options.generate_inline_functions = doit;
+ self
+ }
+
/// Ignore functions.
pub fn ignore_functions(mut self) -> Builder {
self.options.codegen_config.functions = false;
@@ -584,6 +594,9 @@ pub struct BindgenOptions {
/// documentation for more details.
pub generate_comments: bool,
+ /// Whether to generate inline functions. Defaults to false.
+ pub generate_inline_functions: bool,
+
/// Wether to whitelist types recursively. Defaults to true.
pub whitelist_recursively: bool,
@@ -654,6 +667,7 @@ impl Default for BindgenOptions {
codegen_config: CodegenConfig::all(),
conservative_inline_namespaces: false,
generate_comments: true,
+ generate_inline_functions: false,
whitelist_recursively: true,
objc_extern_crate: false,
enable_mangling: true,