Say we want to create our own CFRetain and CFRelease functions, called MyRetain and MyRelease. For the latter, we can just write:
void MyRelease(CFTypeRef __attribute__((cf_consumed)) typeRef);
// or
void MyRelease(CFTypeRef CF_RELEASES_ARGUMENT typeRef);
However, for MyRetain it seems we're out of luck. I would have suspected something like this to exist:
void MyRetain(CFTypeRef __attribute__((cf_retained)) typeRef);
// or
void MyRetain(CFTypeRef CF_RETAINS_ARGUMENT typeRef);
Is this simply an omission? Is there maybe an alternative I'm not seeing?
I think the usual case would be to declare it as:
since retaining functions usually return the same value. Release-type functions generally return void so they would have to annotate the argument.