From ba68ba85c0ff8122f33cffa870ca9ca3988b8799 Mon Sep 17 00:00:00 2001 From: jcmichelou Date: Sun, 7 May 2017 18:18:33 +0200 Subject: [PATCH] Do not make exported symbols different between release and debug builds, this breaks the ABI of the DLL. Do not make reference to NDEBUG in public headers to modify the ABI. This macro is defined automatically in all windows projects and will create a lot of confusion. --- include/coap/debug.h | 13 ------------- src/debug.c | 4 ---- 2 files changed, 17 deletions(-) diff --git a/include/coap/debug.h b/include/coap/debug.h index e7c86aff..356f401e 100644 --- a/include/coap/debug.h +++ b/include/coap/debug.h @@ -58,8 +58,6 @@ void coap_log_impl(coap_log_t level, const char *format, ...); #define coap_log(...) coap_log_impl(__VA_ARGS__) #endif -#ifndef NDEBUG - /* A set of convenience macros for common log levels. */ #define info(...) coap_log(LOG_INFO, __VA_ARGS__) #define warn(...) coap_log(LOG_WARNING, __VA_ARGS__) @@ -71,15 +69,4 @@ void coap_show_pdu(const coap_pdu_t *); struct coap_address_t; size_t coap_print_addr(const struct coap_address_t *, unsigned char *, size_t); -#else - -#define debug(...) -#define info(...) -#define warn(...) - -#define coap_show_pdu(x) -#define coap_print_addr(...) - -#endif /* NDEBUG */ - #endif /* _COAP_DEBUG_H_ */ diff --git a/src/debug.c b/src/debug.c index c72c9e07..fca920d6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -101,8 +101,6 @@ print_timestamp(char *s, size_t len, coap_tick_t t) { #endif /* HAVE_TIME_H */ -#ifndef NDEBUG - #ifndef HAVE_STRNLEN /** * A length-safe strlen() fake. @@ -483,8 +481,6 @@ coap_show_pdu(const coap_pdu_t *pdu) { } -#endif /* NDEBUG */ - void coap_log_impl(coap_log_t level, const char *format, ...) { char timebuf[32];