3 ms·
I prefer the single file solution too. I suppose it comes down to how much having escape markers on every line of the function implementation bothers you, and i
by alxmdev 12y ago
I prefer the single file solution too. I suppose it comes down to how much having escape markers on every line of the function implementation bothers you, and if your favorite code editor does full syntax highlighting in such a case.
- arquivo 12y agoThere is also a version with a normal function: http://pastebin.com/Wesjzs1A http://pastebin.com/Wesjzs1A Solution in the article is overly convoluted.
- alxmdev 12y agoYes, but that is now a worker function that handles every if(n == x) case explicitly in the body, not something you need the preprocessor for anymore. Nothing against it, but it is a different design.
- arquivo 12y agoI copied the function from the article, they are identical. This was done intentionally to show how convoluted the article is.
- alxmdev 12y agoI see. I was thinking in the context of your second pastebin link and the evil_template.c snippet in the article, where the functions are actually generic (and in which case you can't avoid the function being declared as a macro unless you go the multiple-includes route).