Nicolas Williams wrote: >> Remember that syslog is a varargs function. Unless you're willing to make >> assumptions about how rpcgen uses it (which, granted, aren't all that >> unreasonable; it always uses the same variation) or are willing to require >> C99, you can't override it with a macro. > > You don't have to define a macro that takes arguments... You're only > renaming the symbol.
Ah, duh. Yes: you could do that with three public interfaces: 1) That rpcgen uses syslog for this purpose (which is already defined by -L) 2) That rpcgen does not use syslog for other purposes 3) That a %#define line is interposed at the right place to affect the syslog calls in the generated code, but not to affect references in the included header files. (That's why -Dsyslog=mylog isn't good enough, because it could well cause problems with syslog.h.) I would accept that as an answer for my problem. That'd be nice - no code changes, just documenting the idiom. Formally it's still take an ARC case to guarantee that it'd work.