Fix fmtlib including windows.h everywhere

This commit is contained in:
DankParrot 2020-08-22 16:40:09 -07:00
parent 52d583c4c1
commit 75c1f4ce01
2 changed files with 37 additions and 36 deletions

View File

@ -3,16 +3,9 @@
#include <cstdio> #include <cstdio>
#include <cstdarg> #include <cstdarg>
#ifdef _WIN32 // Instead of defining FMT_HEADER_ONLY or building fmtlib
// we can just include all implementation code in Logger.cpp
#ifndef WIN32_LEAN_AND_MEAN #include "fmt/src/format.cc"
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
namespace Feather::Log namespace Feather::Log
{ {
@ -36,9 +29,21 @@ namespace Feather::Log
return *s_logger; return *s_logger;
} }
}
namespace #ifdef _WIN32
{
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
namespace
{
class LoggingManager class LoggingManager
{ {
public: public:
@ -60,6 +65,5 @@ namespace Feather::Log
} }
}; };
static LoggingManager s_networkManager; static LoggingManager s_loggingManager;
}
} }

View File

@ -1,8 +1,5 @@
#pragma once #pragma once
#include <event2/event.h>
#define FMT_HEADER_ONLY
#include <fmt/core.h> #include <fmt/core.h>
#include <fmt/color.h> #include <fmt/color.h>
#include <ostream> #include <ostream>