윈도우용 코드 완성
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#elif __linux__
|
||||
#include <errno.h>
|
||||
#else
|
||||
#error "이 플랫폼은 지원되지 않습니다."
|
||||
#endif
|
||||
|
||||
#include <gsl/gsl>
|
||||
|
||||
namespace Chattr::error {
|
||||
void critical(gsl::czstring msg);
|
||||
void error(gsl::czstring msg);
|
||||
}
|
||||
7
include/Socket/Log.hpp
Normal file
7
include/Socket/Log.hpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "precomp.hpp"
|
||||
|
||||
namespace Chattr::log {
|
||||
void critical(gsl::czstring msg);
|
||||
void error(gsl::czstring msg);
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#elif __linux__
|
||||
|
||||
#else
|
||||
#error "이 플랫폼은 지원되지 않습니다."
|
||||
#endif
|
||||
#include "precomp.hpp"
|
||||
|
||||
namespace Chattr {
|
||||
|
||||
struct Socket_Init {
|
||||
Socket_Init();
|
||||
public:
|
||||
Socket_Init(std::int32_t domain, std::int32_t type, std::int32_t protocol);
|
||||
~Socket_Init();
|
||||
|
||||
Socket_Init(const Socket_Init&) = delete;
|
||||
Socket_Init& operator=(const Socket_Init&) = delete;
|
||||
|
||||
SOCKET get() const;
|
||||
private:
|
||||
SOCKET sock_;
|
||||
};
|
||||
|
||||
}
|
||||
14
include/precomp.hpp
Normal file
14
include/precomp.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#elif __linux__
|
||||
#include <errno.h>
|
||||
#define SOCKET std::int32_t
|
||||
#define INVALID_SOCKET -1
|
||||
#else
|
||||
#error "<22><> <20>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>."
|
||||
#endif
|
||||
|
||||
#include <gsl/gsl>
|
||||
Reference in New Issue
Block a user