Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> To fix this, we need to somehow pass the caller's text domain to
> errcontext(). The most straightforward way is to pass it as an extra
> argument. Ideally, errcontext() would be a macro that passes TEXTDOMAIN
> to the underlying function, so that you don't need to change all the
> callers of errcontext():
> #define errcontext(...) errcontext_domain(TEXTDOMAIN, ...)
> But that doesn't work, because it would require varags macros. Anyone
> know a trick to make that work?
This is pretty ugly, but AFAICS it should work:
#define errcontext set_errcontext_domain(TEXTDOMAIN), real_errcontext
But it might be better in the long run to bite the bullet and make
people change all their errcontext calls. There aren't that many,
especially not outside the core code.
regards, tom lane