From fdcf6763505a8f255ee088530408e64d1ac3836e Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 14 Jan 2010 01:39:29 +0000 Subject: svn r62: More MSVC6 compatibility - perr() without variadic in xusb.c (Michael Plante) - dropped LOOP_CONTINUE variadic in windows_usb.c --- examples/xusb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/xusb.c b/examples/xusb.c index 080e468..db2bc45 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -43,7 +43,18 @@ #define msleep(msecs) usleep(1000*msecs) #endif -#define perr(...) fprintf(stderr, __VA_ARGS__) +static int inline perr(char const *format, ...) +{ + va_list args; + int r; + + va_start (args, format); + r = vfprintf(stderr, format, args); + va_end(args); + + return r; +} + #define ERR_EXIT(errcode) do { perr(" libusb error: %d\n", errcode); return -1; } while (0) #define CALL_CHECK(fcall) do { r=fcall; if (r < 0) ERR_EXIT(r); } while (0); #define B(x) (((x)!=0)?1:0) -- cgit v1.2.1