From cf36852238280363472ae0a91843f98520c201d5 Mon Sep 17 00:00:00 2001 From: Christos Date: Mon, 17 Dec 2018 19:08:02 -0800 Subject: [PATCH] Wrap gnu::format around #if to avoid msvc warnings (#291) * Wrap gnu::format around #if to avoid msvc warnings * Fix compilation issue --- src/g3log/logcapture.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/g3log/logcapture.hpp b/src/g3log/logcapture.hpp index 79fd5cf..6c369dc 100644 --- a/src/g3log/logcapture.hpp +++ b/src/g3log/logcapture.hpp @@ -53,14 +53,15 @@ struct LogCapture { # else # define G3LOG_FORMAT_STRING __format_string # endif + + void capturef(G3LOG_FORMAT_STRING const char *printf_like_message, ...); #else # define G3LOG_FORMAT_STRING -#endif // Use "-Wall" to generate warnings in case of illegal printf format. // Ref: http://www.unixwiz.net/techtips/gnu-c-attributes.html [[gnu::format(printf, 2, 3)]] void capturef(G3LOG_FORMAT_STRING const char *printf_like_message, ...); // 2,3 ref: http://www.codemaestro.com/reviews/18 - +#endif /// prettifying API for this completely open struct std::ostringstream &stream() {