Skip to content

Draft: C Interfacing

Richard Angersbach requested to merge rangersbach/c-interfacing into master

This MR enables C compatibility for the generated target code

  • Adds SfgConfig.c_interfacing option that automatically marks all function declarations as extern "C"
  • Provides hybrid compilation mode for header files where C/C++ includes and also function definitions are guarded by
#ifdef __cplusplus 
<cpp includes...>

#define EXTERNC extern "C"
#else 
<hybrid includes...>

#define EXTERN C
#endif
  • Automatically converts C++ header includes, e.g. <cstdint>, to C compatible header includes, e.g. <stdint.h>, for hybrid mode

Merge request reports