I have a C++ header file, which I am including in a project running with a C compiler. and I have a few errors in the C++ header file since the syntaxes are different for both the compilers, obviously. But the hurdle is I should not modify the c++ header file. I tried using 'C' extern after reading from a few posts but seems the C compiler is not recognizing "__cplusplus".
is there any way that can be implemented in a C header file to include a C++ header file??
for eg. the C compiler is giving an error "Identifier 'Current' is undefined", because there is a 'struct' keyword missing in front of 'Current' in below code.
struct Current {
uint16_t mini;
uint16_t maxi;
uint16_t counter;
};
struct someConstraint {
union {
Current ac_curr;
};
};
Please help and thank you !!
VP