Wrap gnu::format around #if to avoid msvc warnings (#291)

* Wrap gnu::format around #if to avoid msvc warnings

* Fix compilation issue
This commit is contained in:
Christos 2018-12-17 19:08:02 -08:00 committed by Kjell Hedström
parent 048b23d38c
commit cf36852238

View File

@ -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() {