mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-13 10:42:56 +01:00
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:
parent
048b23d38c
commit
cf36852238
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user