Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / MLNLFFIGen.adoc
1 MLNLFFIGen
2 ==========
3
4 `mlnlffigen` generates a <:MLNLFFI:> binding from a collection of `.c`
5 files. It is based on the <:CKitLibrary:>, which is primarily designed
6 to handle standardized C and thus does not understand many (any?)
7 compiler extensions; however, it attempts to recover from errors when
8 seeing unrecognized definitions.
9
10 In order to work around common gcc extensions, it may be useful to add
11 `-cppopt` options to the command line; for example
12 `-cppopt '-D__extension__'` may be occasionally useful. Fortunately,
13 most portable libraries largely avoid the use of these types of
14 extensions in header files.
15
16 `mlnlffigen` will normally not generate bindings for `#included`
17 files; see `-match` and `-allSU` if this is desirable.