mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Fix global variables collision with libusb
This commit is contained in:
committed by
Bastien Nocera
parent
3b409c767c
commit
ff02115b0f
@@ -291,25 +291,25 @@ void fpi_log(enum fpi_log_level level, const char *component,
|
|||||||
#ifndef ENABLE_DEBUG_LOGGING
|
#ifndef ENABLE_DEBUG_LOGGING
|
||||||
if (!log_level)
|
if (!log_level)
|
||||||
return;
|
return;
|
||||||
if (level == LOG_LEVEL_WARNING && log_level < 2)
|
if (level == FPRINT_LOG_LEVEL_WARNING && log_level < 2)
|
||||||
return;
|
return;
|
||||||
if (level == LOG_LEVEL_INFO && log_level < 3)
|
if (level == FPRINT_LOG_LEVEL_INFO && log_level < 3)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case LOG_LEVEL_INFO:
|
case FPRINT_LOG_LEVEL_INFO:
|
||||||
prefix = "info";
|
prefix = "info";
|
||||||
break;
|
break;
|
||||||
case LOG_LEVEL_WARNING:
|
case FPRINT_LOG_LEVEL_WARNING:
|
||||||
stream = stderr;
|
stream = stderr;
|
||||||
prefix = "warning";
|
prefix = "warning";
|
||||||
break;
|
break;
|
||||||
case LOG_LEVEL_ERROR:
|
case FPRINT_LOG_LEVEL_ERROR:
|
||||||
stream = stderr;
|
stream = stderr;
|
||||||
prefix = "error";
|
prefix = "error";
|
||||||
break;
|
break;
|
||||||
case LOG_LEVEL_DEBUG:
|
case FPRINT_LOG_LEVEL_DEBUG:
|
||||||
stream = stderr;
|
stream = stderr;
|
||||||
prefix = "debug";
|
prefix = "debug";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -33,10 +33,10 @@
|
|||||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||||
|
|
||||||
enum fpi_log_level {
|
enum fpi_log_level {
|
||||||
LOG_LEVEL_DEBUG,
|
FPRINT_LOG_LEVEL_DEBUG,
|
||||||
LOG_LEVEL_INFO,
|
FPRINT_LOG_LEVEL_INFO,
|
||||||
LOG_LEVEL_WARNING,
|
FPRINT_LOG_LEVEL_WARNING,
|
||||||
LOG_LEVEL_ERROR,
|
FPRINT_LOG_LEVEL_ERROR,
|
||||||
};
|
};
|
||||||
|
|
||||||
void fpi_log(enum fpi_log_level, const char *component, const char *function,
|
void fpi_log(enum fpi_log_level, const char *component, const char *function,
|
||||||
@@ -53,14 +53,14 @@ void fpi_log(enum fpi_log_level, const char *component, const char *function,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_LOGGING
|
#ifdef ENABLE_DEBUG_LOGGING
|
||||||
#define fp_dbg(fmt...) _fpi_log(LOG_LEVEL_DEBUG, fmt)
|
#define fp_dbg(fmt...) _fpi_log(FPRINT_LOG_LEVEL_DEBUG, fmt)
|
||||||
#else
|
#else
|
||||||
#define fp_dbg(fmt...)
|
#define fp_dbg(fmt...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define fp_info(fmt...) _fpi_log(LOG_LEVEL_INFO, fmt)
|
#define fp_info(fmt...) _fpi_log(FPRINT_LOG_LEVEL_INFO, fmt)
|
||||||
#define fp_warn(fmt...) _fpi_log(LOG_LEVEL_WARNING, fmt)
|
#define fp_warn(fmt...) _fpi_log(FPRINT_LOG_LEVEL_WARNING, fmt)
|
||||||
#define fp_err(fmt...) _fpi_log(LOG_LEVEL_ERROR, fmt)
|
#define fp_err(fmt...) _fpi_log(FPRINT_LOG_LEVEL_ERROR, fmt)
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
#define BUG_ON(condition) \
|
#define BUG_ON(condition) \
|
||||||
|
|||||||
Reference in New Issue
Block a user