https://en.wikipedia.org/wiki/X_macro claims they go back to the 01960s, but unfortunately the reference is to a DDJ article. Is there a chance we could like run a Kickstarter to buy DDJ's archives and fix their website?
You could try, I contacted the new owners awhile ago. They don't/won't even sell new copies of the archive dvd. I tried. https://news.ycombinator.com/item?id=14345682 but a kind soul responded to that request :)
Sad part is that the DVD doesn't have issues going back to when it started as "Dr. Dobb's Journal of COMPUTER Calisthenics & Orthodontia Running Light Without Overbyte"
I have a like 81-84 that I should just send to the IA.
The Living Computer Museum had a small library that had the complete archive of Dr Dobbs, but who knows where it went after Paul Allen's sister closed it and sold everything off.
Y'know, I've never actually seen this before, but that makes a lot of sense. They're also (of course) a common pattern in C, and probably basically any language that has a C-style preprocessor.
I've seen them in 1970s assembler code.