Skip to content

Instantly share code, notes, and snippets.

@lqez
Created January 4, 2012 08:21
Show Gist options
  • Select an option

  • Save lqez/1559081 to your computer and use it in GitHub Desktop.

Select an option

Save lqez/1559081 to your computer and use it in GitHub Desktop.
Use define variable in define
#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