Files
NP_Midterm/impl/Socket/Error.cpp
2025-04-21 19:58:25 +09:00

29 lines
605 B
C++

#include "Socket/Error.hpp"
#include "spdlog/spdlog.h"
namespace Chattr::error {
void critical(gsl::czstring msg) {
#ifdef _WIN32
//TODO 윈도우에서 구현할 것
#elif __linux__
gsl::czstring msgbuf = strerror(errno);
#else
#error "이 플랫폼은 지원되지 않습니다."
#endif
spdlog::critical(msgbuf);
std::exit(EXIT_FAILURE);
}
void error(gsl::czstring msg) {
#ifdef _WIN32
//TODO 윈도우에서 구현할 것
#elif __linux__
gsl::czstring msgbuf = strerror(errno);
#else
#error "이 플랫폼은 지원되지 않습니다."
#endif
spdlog::error(msgbuf);
}
}