fix:修正win下编译和显示问题。
This commit is contained in:
		
							parent
							
								
									44735dc387
								
							
						
					
					
						commit
						3356ceee67
					
				@ -5,6 +5,15 @@
 | 
			
		||||
#include <iostream>
 | 
			
		||||
#include <regex>
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
#include <io.h>
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
 | 
			
		||||
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
std::shared_ptr<spdlog::logger> g_Logger = nullptr;
 | 
			
		||||
std::shared_ptr<CServerConfig> g_Config = nullptr;
 | 
			
		||||
 | 
			
		||||
@ -85,6 +94,15 @@ bool exec_cmd(const CmdParam& param, bool& run)
 | 
			
		||||
 | 
			
		||||
int main(int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
 | 
			
		||||
    DWORD mode;
 | 
			
		||||
    GetConsoleMode(hConsole, &mode);
 | 
			
		||||
    mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
 | 
			
		||||
    SetConsoleMode(hConsole, mode);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    g_Config = std::make_shared<CServerConfig>();
 | 
			
		||||
    if (!g_Config->baseInit()) {
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
@ -4,6 +4,7 @@
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
#include <functional>
 | 
			
		||||
#include <iomanip>
 | 
			
		||||
#include <sstream>
 | 
			
		||||
#include <spdlog/fmt/bundled/color.h>
 | 
			
		||||
#include <spdlog/fmt/fmt.h>
 | 
			
		||||
#include <spdlog/sinks/rotating_file_sink.h>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user