| 1 |
// #pragma push_macro/pop_macro |
| 2 |
#define INCLUDE_A |
| 3 |
#pragma push_macro("INCLUDE_A") |
| 4 |
#undef INCLUDE_A |
| 5 |
#pragma pop_macro("INCLUDE_A") |
| 6 |
|
| 7 |
#ifdef INCLUDE_A |
| 8 |
#include "a.h" |
| 9 |
#endif |
| 10 |
|
| 11 |
// #pragma push_macro/pop_macro with argument macro expansion |
| 12 |
#define INCLUDE_B |
| 13 |
#define MACRO_NAME "INCLUDE_B" |
| 14 |
|
| 15 |
#pragma push_macro(MACRO_NAME) |
| 16 |
#undef INCLUDE_B |
| 17 |
#pragma pop_macro(MACRO_NAME) |
| 18 |
|
| 19 |
#ifdef INCLUDE_B |
| 20 |
#include "b.h" |
| 21 |
#endif |
| 22 |
|
| 23 |
// #pragma include_alias (MS specific) |
| 24 |
// When compiling without MS Extensions, the pragma is not recognized, |
| 25 |
// and the file c_alias.h is included instead of c.h |
| 26 |
#pragma include_alias("c_alias.h", "c.h") |
| 27 |
#include "c_alias.h" |