I have a not very well documented c library which allows me to override some functions. But sadly there are no examples :(
library.h:
#ifndef some_function
uint8_t some_function(void);
#endif
So I defined a function like this in my c++ code:
#include "library.h"
extern "C" uint8_t some_function(void) { return 0;}
void main() {
....
}
but it uses the code define in the library.
Next try:
#define some_function
#include "library.h"
uint8_t some_function(void) { return 0;}
results in:
src/main.cpp: error: expected unqualified-id before 'void'
extern "C" uint8_t some_function(void);
because function name is replaced by the define.
Any suggestions?