diff options
author | Pete Batard <pete@akeo.ie> | 2012-07-02 23:39:19 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2012-07-03 11:01:41 +0100 |
commit | 7ec94a45ed8155e7a1d4d5d75575099b09c78834 (patch) | |
tree | ac57151fceac382b0e80567f2563bb44efb88e91 /libusb/libusbi.h | |
parent | 63f569be66a40a720bb797a87c3589f3e4de925a (diff) | |
download | libusbx-7ec94a45ed8155e7a1d4d5d75575099b09c78834.tar.gz |
Core: Prefix LOG_LEVEL_ with LIBUSB_ to avoid conflictsbaserock/morph
* The LOG_LEVEL_ enums, that were moved to the public API
in 933a319469bcccc962031c989e39d9d1f44f2885 may conflict
with applications/headers that also define their own
LOG_LEVEL_ values internally.
* As a matter of fact, as per Trac #31, this produces a
conflict with libusb-compat, as it defines its own levels.
Diffstat (limited to 'libusb/libusbi.h')
-rw-r--r-- | libusb/libusbi.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h index 27362f7..3c4a059 100644 --- a/libusb/libusbi.h +++ b/libusb/libusbi.h @@ -130,25 +130,25 @@ static inline void *usbi_reallocf(void *ptr, size_t size) #define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0) -void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, +void usbi_log(struct libusb_context *ctx, enum libusb_log_level level, const char *function, const char *format, ...); -void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, +void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, const char *function, const char *format, va_list args); #if !defined(_MSC_VER) || _MSC_VER >= 1400 #ifdef ENABLE_LOGGING #define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__) -#define usbi_dbg(...) _usbi_log(NULL, LOG_LEVEL_DEBUG, __VA_ARGS__) +#define usbi_dbg(...) _usbi_log(NULL, LIBUSB_LOG_LEVEL_DEBUG, __VA_ARGS__) #else #define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0) #define usbi_dbg(...) do {} while(0) #endif -#define usbi_info(ctx, ...) _usbi_log(ctx, LOG_LEVEL_INFO, __VA_ARGS__) -#define usbi_warn(ctx, ...) _usbi_log(ctx, LOG_LEVEL_WARNING, __VA_ARGS__) -#define usbi_err(ctx, ...) _usbi_log(ctx, LOG_LEVEL_ERROR, __VA_ARGS__) +#define usbi_info(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_INFO, __VA_ARGS__) +#define usbi_warn(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_WARNING, __VA_ARGS__) +#define usbi_err(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_ERROR, __VA_ARGS__) #else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ @@ -166,16 +166,16 @@ void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, static inline void usbi_info(struct libusb_context *ctx, const char *format, ...) - LOG_BODY(ctx,LOG_LEVEL_INFO) + LOG_BODY(ctx,LIBUSB_LOG_LEVEL_INFO) static inline void usbi_warn(struct libusb_context *ctx, const char *format, ...) - LOG_BODY(ctx,LOG_LEVEL_WARNING) + LOG_BODY(ctx,LIBUSB_LOG_LEVEL_WARNING) static inline void usbi_err( struct libusb_context *ctx, const char *format, ...) - LOG_BODY(ctx,LOG_LEVEL_ERROR) + LOG_BODY(ctx,LIBUSB_LOG_LEVEL_ERROR) static inline void usbi_dbg(const char *format, ...) - LOG_BODY(NULL,LOG_LEVEL_DEBUG) + LOG_BODY(NULL,LIBUSB_LOG_LEVEL_DEBUG) #endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ |