Merge pull request #3 from lioncash/include

General: Amend includes where applicable
This commit is contained in:
2019-09-03 00:36:09 -07:00
committed by GitHub
6 changed files with 43 additions and 19 deletions

View File

@@ -1,7 +1,13 @@
#include "jbus/Endpoint.hpp"
#include <cstring>
#define LOG_TRANSFER 0
#if LOG_TRANSFER
#include <cstdio>
#endif
namespace jbus {
#define ROUND_UP_8(val) (((val) + 7) & ~7)

View File

@@ -1,8 +1,14 @@
#include "jbus/Listener.hpp"
#include "jbus/Common.hpp"
#include "jbus/Endpoint.hpp"
#define LOG_LISTENER 0
#if LOG_LISTENER
#include <cstdio>
#endif
namespace jbus {
void Listener::listenerProc() {
@@ -94,6 +100,8 @@ std::unique_ptr<Endpoint> Listener::accept() {
return {};
}
Listener::Listener() = default;
Listener::~Listener() { stop(); }
} // namespace jbus

View File

@@ -1,13 +1,19 @@
#include "jbus/Socket.hpp"
#include <cstdio>
#include <cstring>
#ifndef _WIN32
#include <sys/socket.h>
#include <cerrno>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <cerrno>
#else
#include <WinSock2.h>
#include <Ws2tcpip.h>
@@ -100,7 +106,7 @@ void Socket::setRemoteSocket(int remSocket) noexcept {
}
#ifdef _WIN32
Socket::EResult Socket::LastWSAError() {
Socket::EResult Socket::LastWSAError() noexcept {
switch (WSAGetLastError()) {
case WSAEWOULDBLOCK:
case WSAEALREADY: