mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Split off logging helpers
This commit is contained in:
@@ -22,37 +22,19 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef FP_COMPONENT
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "libfprint-"FP_COMPONENT
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
#include <glib.h>
|
||||
#include <libusb.h>
|
||||
|
||||
#include "fprint.h"
|
||||
#include "fpi-log.h"
|
||||
#include "drivers/driver_ids.h"
|
||||
|
||||
#define container_of(ptr, type, member) ({ \
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||
|
||||
#define fp_dbg g_debug
|
||||
#define fp_info g_debug
|
||||
#define fp_warn g_warning
|
||||
#define fp_err g_warning
|
||||
|
||||
#define BUG_ON(condition) G_STMT_START \
|
||||
if (condition) { \
|
||||
char *s; \
|
||||
s = g_strconcat ("BUG: (", #condition, ")", NULL); \
|
||||
g_warning ("%s: %s() %s:%d", s, G_STRFUNC, __FILE__, __LINE__); \
|
||||
g_free (s); \
|
||||
} G_STMT_END
|
||||
#define BUG() BUG_ON(1)
|
||||
|
||||
enum fp_dev_state {
|
||||
DEV_STATE_INITIAL = 0,
|
||||
DEV_STATE_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user