In a few C programs (for example in gecko) I've noticed an idiom whereby a program will temporarily define a macro, then include a file which uses that macro, then undefine the macro. Here's a trivial example:
speak.c:
#define SPEAK(phrase) (printf("When I speak I say %s\n", (phrase)))
#include "dog.h"
#undef SPEAK
dog.h:
SPEAK("woof");
Which expands to:
(printf("When I speak I say %s\n", ("woof")))
I gather this might be a useful technique to generalize included code by being able to specify behavior at the expansion site.
Does this pattern have a name, or has it been written about previously?