diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-12 12:09:13 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-12 12:09:13 +1000 |
commit | 0c185983848ccbc1c3793d6d8333014625639d4e (patch) | |
tree | ddb0bdcbb669743f6241c8a1f76586630254fa4f /hdata | |
parent | f7c8f35ce7328f1b7e0181abf5c6233747570694 (diff) | |
download | skiboot-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.c | 9 |
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; |