diff options
author | Pete Batard <pete@akeo.ie> | 2012-04-09 22:28:34 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2012-04-09 22:28:34 +0100 |
commit | 974251ba94861d03dbe9837a902d84e83d301cda (patch) | |
tree | 78a6326a546edb8bfb8d48cdae1e001b0bab5de8 | |
parent | 312ba2dbf193a2dad4dbce0867f05c8fc0fee5b8 (diff) | |
download | libusb-974251ba94861d03dbe9837a902d84e83d301cda.tar.gz |
Windows: Fix support for variadic macros
* Visual C++ did not support variadic macros until VS2005, as per
http://msdn.microsoft.com/en-us/library/ms177415%28v=VS.80%29.aspx
-rw-r--r-- | libusb/libusbi.h | 6 | ||||
-rw-r--r-- | libusb/os/poll_windows.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h index 9a978ad..fa8597c 100644 --- a/libusb/libusbi.h +++ b/libusb/libusbi.h @@ -131,7 +131,7 @@ void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, const char *function, const char *format, va_list args); -#if !defined(_MSC_VER) || _MSC_VER > 1200 +#if !defined(_MSC_VER) || _MSC_VER >= 1400 #ifdef ENABLE_LOGGING #define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__) @@ -149,7 +149,7 @@ void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, #define usbi_warn(ctx, ...) _usbi_log(ctx, LOG_LEVEL_WARNING, __VA_ARGS__) #define usbi_err(ctx, ...) _usbi_log(ctx, LOG_LEVEL_ERROR, __VA_ARGS__) -#else /* !defined(_MSC_VER) || _MSC_VER > 1200 */ +#else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ #ifdef ENABLE_LOGGING #define LOG_BODY(ctxt, level) \ @@ -180,7 +180,7 @@ static inline void usbi_dbg(const char *format, ...) { } #endif -#endif /* !defined(_MSC_VER) || _MSC_VER > 1200 */ +#endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ #define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context #define DEVICE_CTX(dev) ((dev)->ctx) diff --git a/libusb/os/poll_windows.c b/libusb/os/poll_windows.c index 99cc5e1..5204bcb 100644 --- a/libusb/os/poll_windows.c +++ b/libusb/os/poll_windows.c @@ -52,9 +52,9 @@ #if defined(DEBUG_POLL_WINDOWS) #define poll_dbg usbi_dbg #else -// MSVC6 cannot use a variadic argument and non MSVC +// MSVC++ < 2005 cannot use a variadic argument and non MSVC // compilers produce warnings if parenthesis are ommitted. -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1400 #define poll_dbg #else #define poll_dbg(...) |