I'm using gcc, and I am distributing an object file which may be used in conjunction with some third party code. I have something that looks like this:
void fn3rdParty(int bar) __attribute ((weak));
void fn(void) {
if(fn3rdParty)
fn3rdParty(SOME_ENUM);
}
where SOME_ENUM is an enum and is defined by the third party code if present. I tried declaring SOME_ENUM as a weak int, but gcc complains that the type is redefined. I'm wondering if there's a way around this? (I'd like to avoid having one .o file for use with this software, and another to be used without).
John