diff --git a/cmake/config.h.in b/cmake/config.h.in index 0aaf0e7..b272ea0 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -5,6 +5,16 @@ #cmakedefine CPPMICROHTTPD_LOGGING_STDCOUT #cmakedefine CPPMICROHTTPD_LOGGING_CPPLOGGING +namespace __impl +{ + struct fake_log + { + template + fake_log& operator << (T_args&&...) + { return *this; } + }; +} + #if defined(CPPMICROHTTPD_LOGGING_CPPLOGGING) #include #define cppmicrohttpd_log(p_level) \ @@ -20,11 +30,11 @@ cppmicrohttpd_log(debug) << __VA_ARGS__ #else #define cppmicrohttpd_log_debug(...) \ - do { } while (0) + __impl::fake_log() #endif #else #define cppmicrohttpd_log(...) \ - do { } while (0) + __impl::fake_log() #define cppmicrohttpd_log_debug(...) \ - do { } while (0) + __impl::fake_log() #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd61b07..05fd49b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,6 +15,8 @@ ElseIf ( CPPMICROHTTPD_LOGGING MATCHES cpplogging ) Find_Package ( cpplogging QUIET ) If ( cpplogging_FOUND ) Set ( CPPMICROHTTPD_LOGGING_CPPLOGGING true ) + Else ( ) + Set ( CPPMICROHTTPD_LOGGING_STDCOUT true ) EndIf ( ) EndIf ( )