I want to force the preprocessor to do some automatic code generation for me. I don\'t need much: just a simple for-loop that contains another for-loop.[1]
I\'ve
Vesa Karvonen's "Order" library/language can definitely do this for you. It implements unrestricted recursion and looping in the C preprocessor, and as a really cool bonus dresses it up with the nice concise syntax of a "proper" programming language (to clarify: this is not an alternative preprocessor, it just does a lot of token-pasting to keep its keywords short. It is still pure CPP).
It uses a rather different technique, converting your metaprograms to CPS and then passing them to a single loop construct that has potentially trillions of steps, and executes the metaprogram in a strictly linear fashion. Loops and recursive functions can therefore be nested as deeply as you like because they don't have separate drivers that need to interact and paint each other blue.
Yes really, someone implemented a full virtual machine and interpreter using CPP macros. It's intimidating.
(EDIT: try the archived version if Rosetta Code has stopped working for you too.)