aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-05-12 12:09:13 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-12 12:09:13 +1000
commit0c185983848ccbc1c3793d6d8333014625639d4e (patch)
treeddb0bdcbb669743f6241c8a1f76586630254fa4f /hdata
parentf7c8f35ce7328f1b7e0181abf5c6233747570694 (diff)
downloadskiboot-0c185983848ccbc1c3793d6d8333014625639d4e.zip
skiboot-0c185983848ccbc1c3793d6d8333014625639d4e.tar.gz
skiboot-0c185983848ccbc1c3793d6d8333014625639d4e.tar.bz2
Add pr_fmt to do printf/prlog prefixing automagically
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/test/stubs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index b4bfa03..16f75ba 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -17,9 +17,14 @@
#include <stdio.h>
#include <stdarg.h>
-void prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
+void _prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
-void prlog(int log_level __attribute__((unused)), const char* fmt, ...)
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+#define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
+
+void _prlog(int log_level __attribute__((unused)), const char* fmt, ...)
{
va_list ap;