summaryrefslogtreecommitdiff
path: root/stringify
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-03-04 14:12:51 +0100
committerTobias Klauser <klto@zhaw.ch>2010-03-04 14:12:51 +0100
commita91fab8e160c4717b184b9963537f68b353cb173 (patch)
treebd59623730f8e452e4fdb70cde9423c31987be99 /stringify
Add stringify header
Diffstat (limited to 'stringify')
-rw-r--r--stringify/stringify.h15
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_ */