File: stringify.h

package info (click to toggle)
etlcpp 20.44.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,692 kB
  • sloc: cpp: 302,710; ansic: 11,683; sh: 1,420; asm: 301; python: 281; makefile: 16
file content (20 lines) | stat: -rw-r--r-- 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef ETL_ETL_STRINGIFY_INCLUDED
#define ETL_ETL_STRINGIFY_INCLUDED

#ifndef STRINGIFY
/** Helper macro for STRINGIFY. */
#define STRINGIFY_1(...) #__VA_ARGS__

/**
 * Indirect stringification.
 *
 * Doing two levels allows the parameter to be a macro itself.
 * For example, compile with `-DFOO=bar`, `STRINGIFY(FOO)` converts to "bar".
 *
 * \param x will be converted to one string, including the spaces and commas between arguments.
 *             For example `STRINGIFY( a , b )` will be expanded to "a , b".
 */
#define STRINGIFY(...) STRINGIFY_1(__VA_ARGS__)
#endif /* STRINGIFY */

#endif /* ETL_ETL_STRINGIFY_INCLUDED */