mirror of
https://github.com/KjellKod/g3log.git
synced 2025-03-04 07:27:25 +01:00
msfc fromat specifiers added
This commit is contained in:
parent
ba81287ca5
commit
1dafdaf2a4
@ -16,6 +16,9 @@
|
||||
#include <sstream>
|
||||
#include <cstdarg>
|
||||
#include <csignal>
|
||||
#ifdef _MSC_VER
|
||||
# include <sal.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Simple struct for capturing log/fatal entries. At destruction the captured message is
|
||||
@ -50,7 +53,16 @@ struct LogCapture {
|
||||
#ifndef __GNUC__
|
||||
#define __attribute__(x) // Disable 'attributes' if compiler does not support 'em
|
||||
#endif
|
||||
void capturef(const char *printf_like_message, ...) __attribute__((format(printf, 2, 3))); // 2,3 ref: http://www.codemaestro.com/reviews/18
|
||||
#ifdef _MSC_VER
|
||||
# if _MSC_VER >= 1400
|
||||
# define G3LOG_FORMAT_STRING _Printf_format_string_
|
||||
# else
|
||||
# define G3LOG_FORMAT_STRING __format_string
|
||||
# endif
|
||||
#else
|
||||
# define G3LOG_FORMAT_STRING
|
||||
#endif
|
||||
void capturef(G3LOG_FORMAT_STRING const char *printf_like_message, ...) __attribute__((format(printf, 2, 3))); // 2,3 ref: http://www.codemaestro.com/reviews/18
|
||||
|
||||
|
||||
/// prettifying API for this completely open struct
|
||||
|
Loading…
x
Reference in New Issue
Block a user