diff options
author | Pete Batard <pbatard@gmail.com> | 2010-01-14 01:39:29 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-01-14 01:39:29 +0000 |
commit | fdcf6763505a8f255ee088530408e64d1ac3836e (patch) | |
tree | 2e0bcd71ea9687bce62833ad3e1382389d7691b1 /examples | |
parent | f6a685a4eae613c2c69aab75f926146cf4803cf4 (diff) | |
download | libusb-fdcf6763505a8f255ee088530408e64d1ac3836e.tar.gz |
svn r62: More MSVC6 compatibility
- perr() without variadic in xusb.c (Michael Plante)
- dropped LOOP_CONTINUE variadic in windows_usb.c
Diffstat (limited to 'examples')
-rw-r--r-- | examples/xusb.c | 13 |
1 files changed, 12 insertions, 1 deletions
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) |