diff options
author | Pete Batard <pbatard@gmail.com> | 2010-01-14 01:37:47 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-01-14 01:37:47 +0000 |
commit | e026f61422cd5439eac40a66fd41f7659061e60a (patch) | |
tree | 963770defd4894319516614919f2c0906d3f4718 /libusb/core.c | |
parent | 29ed28f769cf0985c89c739117cd19094c8871c8 (diff) | |
download | libusb-e026f61422cd5439eac40a66fd41f7659061e60a.tar.gz |
svn r59: - MSVC6 fixes for variadic log macros (Michael Plante)
Diffstat (limited to 'libusb/core.c')
-rw-r--r-- | libusb/core.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libusb/core.c b/libusb/core.c index 535ecf3..1728e35 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -1546,10 +1546,9 @@ API_EXPORTED void libusb_exit(struct libusb_context *ctx) free(ctx); } -void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, - const char *function, const char *format, ...) +void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, + const char *function, const char *format, va_list args) { - va_list args; FILE *stream = stdout; const char *prefix; @@ -1587,10 +1586,18 @@ void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, fprintf(stream, "libusb:%s [%s] ", prefix, function); - va_start (args, format); vfprintf(stream, format, args); - va_end (args); fprintf(stream, "\n"); } +void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, + const char *function, const char *format, ...) +{ + va_list args; + + va_start (args, format); + usbi_log_v(ctx, level, function, format, args); + va_end (args); +} + |