Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#define A 0
#define B 1
#define CFG_1_MODE A
#define CFG_2_MODE B
#define CFG_3_MODE A
#define EXPAND(i) IMPL_TMP(CFG_##i##_MODE)(i)
#define IMPL_TMP(mode) IMPL_CAT(mode)
#define IMPL_CAT(mode) IMPL_##mode
#define IMPL_0 IMPL_A
#define IMPL_1 IMPL_B
EXPAND(1)
EXPAND(2)
EXPAND(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment