C code works "out of the box" in C++, but to link a valid executable, C functions needs to be declared as extern "C".
This patch adds a preprocessor define (only active when header is #included by a C++ compiler) enclosing the definitions in an extern "C" block, fixing linkage errors on all platforms.
Also adds relevant comments explaining the presence of the extern "C" block.
C code works "out of the box" in C++, but to link a valid executable, C functions needs to be declared as
extern "C"
.This patch adds a preprocessor define (only active when header is
#include
d by a C++ compiler) enclosing the definitions in anextern "C"
block, fixing linkage errors on all platforms.Also adds relevant comments explaining the presence of the
extern "C"
block.