mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Build system tweaks
Add configure-time controls for logging Set some default compile-time warnings
This commit is contained in:
committed by
Daniel Drake
parent
50e2de0730
commit
2995144310
@@ -4,7 +4,7 @@ UPEKTS_SRC = drivers/upekts.c
|
||||
|
||||
DRIVER_SRC = $(UPEKTS_SRC)
|
||||
|
||||
libfprint_la_CFLAGS = -fvisibility=hidden $(LIBUSB_CFLAGS) $(GLIB_CFLAGS)
|
||||
libfprint_la_CFLAGS = -fvisibility=hidden $(LIBUSB_CFLAGS) $(GLIB_CFLAGS) $(AM_CFLAGS)
|
||||
libfprint_la_LDFLAGS = -version-info @lt_major@:@lt_revision@:@lt_age@
|
||||
libfprint_la_LIBADD = $(LIBUSB_LIBS) $(GLIB_LIBS)
|
||||
|
||||
|
||||
@@ -50,6 +50,10 @@ void fpi_log(enum fpi_log_level level, const char *component,
|
||||
stream = stderr;
|
||||
prefix = "debug";
|
||||
break;
|
||||
default:
|
||||
stream = stderr;
|
||||
prefix = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stream, "%s:%s [%s] ", component ? component : "fp", prefix,
|
||||
@@ -74,7 +78,7 @@ static const struct fp_driver * const drivers[] = {
|
||||
|
||||
static void register_drivers(void)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(drivers); i++)
|
||||
register_driver(drivers[i]);
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef __FPRINT_INTERNAL_H__
|
||||
#define __FPRINT_INTERNAL_H__
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <glib.h>
|
||||
@@ -53,9 +55,18 @@ void fpi_log(enum fpi_log_level, const char *component, const char *function,
|
||||
#define FP_COMPONENT NULL
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_LOGGING
|
||||
#define _fpi_log(level, fmt...) fpi_log(level, FP_COMPONENT, __FUNCTION__, fmt)
|
||||
#else
|
||||
#define _fpi_log(level, fmt...)
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEBUG_LOGGING
|
||||
#define fp_dbg(fmt...) _fpi_log(LOG_LEVEL_DEBUG, fmt)
|
||||
#else
|
||||
#define fp_dbg(fmt...)
|
||||
#endif
|
||||
|
||||
#define fp_info(fmt...) _fpi_log(LOG_LEVEL_INFO, fmt)
|
||||
#define fp_warn(fmt...) _fpi_log(LOG_LEVEL_WARNING, fmt)
|
||||
#define fp_err(fmt...) _fpi_log(LOG_LEVEL_ERROR, fmt)
|
||||
|
||||
Reference in New Issue
Block a user