chiark / gitweb /
secnet.h: provide helpful STRING macro (for preprocessor stringification)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Jul 2011 22:53:55 +0000 (23:53 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 17 Aug 2011 20:59:44 +0000 (21:59 +0100)
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@chiark.greenend.org.uk>
secnet.h

index b60972f..6559ef3 100644 (file)
--- 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 */