/ Published in: C
URL: http://www.keil.com/dd/docs/c51/cypress/fx2regs.h
This uses the concatenation operator "##" to insert a comment "//"
Expand |
Embed | Plain Text
#define _AT_ ;/ ## /
Comments
Subscribe to comments
You need to login to post a comment.

WARNING: We used this snippet to comment out some stream processing code in our application:
define FOO ;/ ## /
...
// somewhere in our code FOO
OK. It looks like I can neither edit my comment or delete it. Anyway, the point of the comment was that this code does NOT work on Linux or Mac. The // type of comment is a preprocessor directive and the preprocessor doesn't do multiple passes. We were commenting stream operators, so creating a dummy class with empty inlined stream operators and replacing the AT with those values worked fine and the compiler optimized out the useless code. Hope this helps someone.