dmlc / tl2cgen

TL2cgen (TreeLite 2 C GENerator) is a model compiler for decision tree models
https://tl2cgen.readthedocs.io/en/latest/
Apache License 2.0
21 stars 6 forks source link

[FEA] Add extern "C" to generated header, so it can be used from C++ programs #33

Open davidelahoz opened 3 months ago

davidelahoz commented 3 months ago

In order to call C libraries from C++, function definitions need to be warped by:

#ifdef __cplusplus
extern "C"{
#endif 

// Funtion declaration...

#ifdef __cplusplus
}
#endif

Automatically adding those lines to the generated header would simplify using classifiers from C++ code