File: get_macro_value.c

package info (click to toggle)
rust-rsconf 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: ansic: 61; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{0}

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)

// Pass the macro itself, it will expand to its value
#define EXFILTRATE_MACRO_VALUE(macro) \
    _Pragma(STRINGIFY(message("EXFIL:::" TOSTRING(macro) ":::EXFIL")))

// Use our new macro to generate a pragma message
#ifdef {1}
EXFILTRATE_MACRO_VALUE({2});
#endif

int main() {{
    return 0;
}}