[PATCH 02/18] secnet.h: provide helpful STRING macro (for preprocessor stringification)
Ian Jackson
ijackson at chiark.greenend.org.uk
Wed Aug 17 23:54:20 BST 2011
Uses preprocessor stringification; can be helpful for rendering
compile-time constants (eg compile time limit macros) for messages,
etc.
Not used yet; will be used later in this series.
Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
secnet.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/secnet.h b/secnet.h
index b60972f..6559ef3 100644
--- a/secnet.h
+++ b/secnet.h
@@ -495,4 +495,7 @@ extern void log_from_fd(int fd, cstring_t prefix, struct log_if *log);
/***** END of log functions *****/
+#define STRING2(x) #x
+#define STRING(x) STRING2(x)
+
#endif /* secnet_h */
--
1.7.2.5
More information about the sgo-software-discuss
mailing list