mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-14 02:57:46 +01:00
Mingw parse error (#293)
* fix 'Failure to successfully parse the message' on mingw * removed redundant checks
This commit is contained in:
parent
502bf318a4
commit
1a010de2f6
@ -11,7 +11,7 @@
|
|||||||
#include "g3log/logcapture.hpp"
|
#include "g3log/logcapture.hpp"
|
||||||
#include "g3log/loglevels.hpp"
|
#include "g3log/loglevels.hpp"
|
||||||
|
|
||||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) && !defined(__GNUC__))
|
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||||
#error "crashhandler_unix.cpp used but it's a windows system"
|
#error "crashhandler_unix.cpp used but it's a windows system"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ void LogCapture::capturef(const char *printf_like_message, ...) {
|
|||||||
#else
|
#else
|
||||||
static const int kMaxMessageSize = 2048;
|
static const int kMaxMessageSize = 2048;
|
||||||
char finished_message[kMaxMessageSize];
|
char finished_message[kMaxMessageSize];
|
||||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) && !defined(__GNUC__))
|
#if ((defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(__GNUC__))
|
||||||
auto finished_message_len = _countof(finished_message);
|
auto finished_message_len = _countof(finished_message);
|
||||||
#else
|
#else
|
||||||
int finished_message_len = sizeof(finished_message);
|
int finished_message_len = sizeof(finished_message);
|
||||||
@ -90,7 +90,7 @@ void LogCapture::capturef(const char *printf_like_message, ...) {
|
|||||||
va_list arglist;
|
va_list arglist;
|
||||||
va_start(arglist, printf_like_message);
|
va_start(arglist, printf_like_message);
|
||||||
|
|
||||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) && !defined(__GNUC__))
|
#if ((defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(__GNUC__))
|
||||||
const int nbrcharacters = vsnprintf_s(finished_message, finished_message_len, _TRUNCATE, printf_like_message, arglist);
|
const int nbrcharacters = vsnprintf_s(finished_message, finished_message_len, _TRUNCATE, printf_like_message, arglist);
|
||||||
#else
|
#else
|
||||||
const int nbrcharacters = vsnprintf(finished_message, finished_message_len, printf_like_message, arglist);
|
const int nbrcharacters = vsnprintf(finished_message, finished_message_len, printf_like_message, arglist);
|
||||||
|
@ -131,7 +131,7 @@ namespace g3 {
|
|||||||
|
|
||||||
tm localtime(const std::time_t& ts) {
|
tm localtime(const std::time_t& ts) {
|
||||||
struct tm tm_snapshot;
|
struct tm tm_snapshot;
|
||||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) && !defined(__GNUC__))
|
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||||
localtime_s(&tm_snapshot, &ts); // windsows
|
localtime_s(&tm_snapshot, &ts); // windsows
|
||||||
#else
|
#else
|
||||||
localtime_r(&ts, &tm_snapshot); // POSIX
|
localtime_r(&ts, &tm_snapshot); // POSIX
|
||||||
|
Loading…
Reference in New Issue
Block a user