summaryrefslogtreecommitdiff
path: root/stringify/stringify.h
diff options
context:
space:
mode:
authorklto <klto@bb4c1ae6-6eb5-4d93-a66e-2307d6765a9c>2010-10-28 07:33:28 +0000
committerklto <klto@bb4c1ae6-6eb5-4d93-a66e-2307d6765a9c>2010-10-28 07:33:28 +0000
commit2f7a7f07846aa498b4b79a83bbe425d7aba73f03 (patch)
tree18c49cd2e8f09c6df38ceab570f72dd52dd51773 /stringify/stringify.h
parentb29885c60c5b8f1b204e78902df728121b5e7cf2 (diff)
parent098c2b10024f57666e381889438e5250ef882a44 (diff)
Merge branch 'master' into local-svn
git-svn-id: https://parma.zhaw.ch/svn/csnippets@2 bb4c1ae6-6eb5-4d93-a66e-2307d6765a9c
Diffstat (limited to 'stringify/stringify.h')
-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_ */