I’m working on an embedded systems which provides an interface with certain types.
The problem is by including certain headers from c standard library I get an error: conflicting types
I use gettimeofday and I’m only using struct timeval, yet for using this sys/time.h also drags in time_t which interferes with the one defined by the system.
I can’t touch either of those pieces of code and I need them both.
Is there a way to get around such issues? (I should be able to use the systems’ declared types and some functions declared in c headers, headers which contain some declarations already done by the system.)
You can use macros to rename one of the
time_ttypedefs without modifying any headers:This is not guaranteed to work, but it does work a lot of the time.