Skip to content
Snippets Groups Projects
Commit 462426f4 authored by Bastian Köcher's avatar Bastian Köcher
Browse files

Adds Cmake switch `DISABLE_DEBUG_PRINTF` for disabling debug printf macro

parent c63e403f
No related merge requests found
......@@ -9,6 +9,10 @@ SET(CMAKE_C_STANDARD 11)
SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
if((NOT ${DISABLE_DEBUG_PRINTF}) OR (NOT DEFINED DISABLE_DEBUG_PRINTF))
SET(CMAKE_C_FLAGS "-DENABLE_DEBUG_PRINTF ${CMAKE_C_FLAGS}")
endif()
INCLUDE_DIRECTORIES(picoquic picoquictest ../picotls/include
${PICOTLS_INCLUDE_DIR})
......
......@@ -51,10 +51,12 @@ int picoquic_is_connection_id_null(picoquic_connection_id_t cnx_id);
int picoquic_compare_connection_id(picoquic_connection_id_t * cnx_id1, picoquic_connection_id_t * cnx_id2);
uint64_t picoquic_val64_connection_id(picoquic_connection_id_t cnx_id);
#ifndef MIN
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifdef ENABLE_DEBUG_PRINTF
#define DBG_PRINTF_FILENAME_MAX 24
#define DBG_PRINTF(fmt, ...) \
debug_printf("%s:%u [%s]: " fmt "\n", \
......@@ -67,4 +69,11 @@ uint64_t picoquic_val64_connection_id(picoquic_connection_id_t cnx_id);
exit(1); \
} while (0)
#else
#define DBG_PRINTF(fmt, ...)
#define DBG_FATAL_PRINTF(fmt, ...)
#endif //#ifdef ENABLE_DEBUG_PRINTF
#endif
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment