msfc fromat specifiers added

This commit is contained in:
SchoenleAndi 2016-10-19 13:41:48 +02:00
parent ba81287ca5
commit 1dafdaf2a4

View File

@ -16,6 +16,9 @@
#include <sstream> #include <sstream>
#include <cstdarg> #include <cstdarg>
#include <csignal> #include <csignal>
#ifdef _MSC_VER
# include <sal.h>
#endif
/** /**
* Simple struct for capturing log/fatal entries. At destruction the captured message is * Simple struct for capturing log/fatal entries. At destruction the captured message is
@ -50,7 +53,16 @@ struct LogCapture {
#ifndef __GNUC__ #ifndef __GNUC__
#define __attribute__(x) // Disable 'attributes' if compiler does not support 'em #define __attribute__(x) // Disable 'attributes' if compiler does not support 'em
#endif #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 /// prettifying API for this completely open struct