[PATCH 1/7] secnet.h: provide helpful STRING macro (for preprocessor stringification)

Ian Jackson ijackson at chiark.greenend.org.uk
Thu Jul 14 01:22:36 BST 2011


Uses preprocessor stringification; can be helpful for rendering
compile-time constants (eg compile time limit macros) for messages,
etc.

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.5.6.5




More information about the sgo-software-discuss mailing list