I'm trying to write a macro that will expand the __COUNTER__ macro only once per source file. I understand fully how macros work with their expansion but I'm having difficulty with this one. I want to expand the __COUNTER__ macro once at the top of the file and then each reference to that define will not expand the __COUNTER__ to it's next number.
So I want to fully expand __COUNTER__ into a single value and then use that one value consistently through the current working source file.
I can only use features that are available to C.