Created
January 4, 2012 08:21
-
-
Save lqez/1559081 to your computer and use it in GitHub Desktop.
Use define variable in define
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define CONCAT_X(t1,t2) t1##t2 | |
| #define CONCAT(t1,t2) CONCAT_X(t1,t2) | |
| /* usage */ | |
| #define PREFIX TAEYEON__ | |
| #define foo CONCAT(PREFIX,foo) | |
| void foo() {} /* this function will be renamed into 'TAEYEON__foo' */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment