mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-19 08:16:35 +00:00
Fix enabling of LIBNFC_DEBUG_OUTPUT
- inclusion of log-printf.c didn't align with needed preprocessor definitions - Added extra #error as well as preprocessor protection - fixed CMakeList to specify -DLOG as appropriate per the header log.h usage
This commit is contained in:
@@ -29,7 +29,7 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
# Options
|
||||
SET(LIBNFC_DEBUG_OUTPUT OFF CACHE BOOL "Debug output of communication with the NFC chip")
|
||||
IF(LIBNFC_DEBUG_OUTPUT)
|
||||
ADD_DEFINITIONS(-DDEBUG -g3)
|
||||
ADD_DEFINITIONS(-DDEBUG -DLOG -g3)
|
||||
ENDIF(LIBNFC_DEBUG_OUTPUT)
|
||||
|
||||
# Doxygen
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
#include <stdarg.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifndef LOG
|
||||
// Leaving in a preprocessor error, as the build system should skip this
|
||||
// file otherwise.
|
||||
#error "No logging defined, but log-printf.c still compiled."
|
||||
#else // LOG
|
||||
|
||||
void
|
||||
log_init(const nfc_context *context)
|
||||
{
|
||||
@@ -67,3 +73,5 @@ log_put(const uint8_t group, const char *category, const uint8_t priority, const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // LOG
|
||||
|
||||
Reference in New Issue
Block a user