diff options
Diffstat (limited to 'stringify/stringify.h')
-rw-r--r-- | stringify/stringify.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/stringify/stringify.h b/stringify/stringify.h new file mode 100644 index 0000000..5b7b002 --- /dev/null +++ b/stringify/stringify.h @@ -0,0 +1,15 @@ +/* Taken from Linux Kernel source code */ + +#ifndef _STRINGIFY_H_ +#define _STRINGIFY_H_ + +/* + * Indirect stringification. Doing two levels allows the parameter to be a + * macro itself. For example, compile with -DFOO=bar, __stringify(FOO) + * converts to "bar". + */ + +#define __stringify_1(x...) #x +#define __stringify(x...) __stringify_1(x) + +#endif /* _STRINGIFY_H_ */ |