From a76b00c511db1d3529bba51475a24ca93d12913e Mon Sep 17 00:00:00 2001 From: Joursoir Date: Tue, 5 Jan 2021 18:07:25 +0300 Subject: client gui: add support windows --- src/client/ClientBase.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/client/ClientBase.hpp') diff --git a/src/client/ClientBase.hpp b/src/client/ClientBase.hpp index a5e76ed..dbe28bd 100644 --- a/src/client/ClientBase.hpp +++ b/src/client/ClientBase.hpp @@ -1,11 +1,19 @@ #ifndef WC_CLIENTBASE_H #define WC_CLIENTBASE_H +#ifdef _WIN32 + #include +#endif + #include "../const_vars.hpp" class ClientBase { protected: +#ifdef _WIN32 + SOCKET fd; +#else int fd; +#endif char out_buffer[max_msg_len]; // for message int out_buf_used; @@ -15,7 +23,7 @@ protected: public: ClientBase(const char* ip, int port); virtual ~ClientBase(); - int ConstuctorError() const { return fd > -1 ? 0 : 1; } + int ConstuctorError() const; int Run(); void BreakLoop() { exit_flag = true; } @@ -24,7 +32,7 @@ public: virtual void AddMessage(const char *msg, const char spec_char) {} void SendMessage(const char *msg); private: - int CreateSocket(const char* ip, int port); + int InitSocket(const char* ip, int port); }; #endif \ No newline at end of file -- cgit v1.2.3-18-g5258