Commit 740cdaf3 authored by Dominik Charousset's avatar Dominik Charousset

Fix formatting

parent 50bb5ed3
......@@ -18,8 +18,8 @@
#pragma once
#include <string>
#include <cstdint>
#include <string>
#include "caf/config.hpp"
#include "caf/detail/io_export.hpp"
......@@ -31,17 +31,17 @@ namespace network {
// Annoying platform-dependent bootstrapping.
#ifdef CAF_WINDOWS
using setsockopt_ptr = const char*;
using getsockopt_ptr = char*;
using socket_send_ptr = const char*;
using socket_recv_ptr = char*;
using socket_size_type = int;
using setsockopt_ptr = const char*;
using getsockopt_ptr = char*;
using socket_send_ptr = const char*;
using socket_recv_ptr = char*;
using socket_size_type = int;
#else
using setsockopt_ptr = const void*;
using getsockopt_ptr = void*;
using socket_send_ptr = const void*;
using socket_recv_ptr = void*;
using socket_size_type = unsigned;
using setsockopt_ptr = const void*;
using getsockopt_ptr = void*;
using socket_send_ptr = const void*;
using socket_recv_ptr = void*;
using socket_size_type = unsigned;
#endif
using signed_size_type = std::make_signed<size_t>::type;
......@@ -53,17 +53,17 @@ CAF_IO_EXPORT extern const int no_sigpipe_socket_flag;
CAF_IO_EXPORT extern const int no_sigpipe_io_flag;
#ifdef CAF_WINDOWS
using native_socket = size_t;
constexpr native_socket invalid_native_socket = static_cast<native_socket>(-1);
inline int64_t int64_from_native_socket(native_socket sock) {
return sock == invalid_native_socket ? -1 : static_cast<int64_t>(sock);
}
using native_socket = size_t;
constexpr native_socket invalid_native_socket = static_cast<native_socket>(-1);
inline int64_t int64_from_native_socket(native_socket sock) {
return sock == invalid_native_socket ? -1 : static_cast<int64_t>(sock);
}
#else
using native_socket = int;
constexpr native_socket invalid_native_socket = -1;
inline int64_t int64_from_native_socket(native_socket sock) {
return static_cast<int64_t>(sock);
}
using native_socket = int;
constexpr native_socket invalid_native_socket = -1;
inline int64_t int64_from_native_socket(native_socket sock) {
return static_cast<int64_t>(sock);
}
#endif
/// Returns the last socket error as an integer.
......@@ -90,7 +90,8 @@ CAF_IO_EXPORT std::pair<native_socket, native_socket> create_pipe();
/// Sets fd to be inherited by child processes if `new_value == true`
/// or not if `new_value == false`. Not implemented on Windows.
/// throws `network_error` on error
CAF_IO_EXPORT expected<void> child_process_inherit(native_socket fd, bool new_value);
CAF_IO_EXPORT expected<void>
child_process_inherit(native_socket fd, bool new_value);
/// Enables keepalive on `fd`. Throws `network_error` on error.
CAF_IO_EXPORT expected<void> keepalive(native_socket fd, bool new_value);
......@@ -108,7 +109,8 @@ CAF_IO_EXPORT expected<void> tcp_nodelay(native_socket fd, bool new_value);
CAF_IO_EXPORT expected<void> allow_sigpipe(native_socket fd, bool new_value);
/// Enables or disables `SIO_UDP_CONNRESET`error on `fd`.
CAF_IO_EXPORT expected<void> allow_udp_connreset(native_socket fd, bool new_value);
CAF_IO_EXPORT expected<void>
allow_udp_connreset(native_socket fd, bool new_value);
/// Get the socket buffer size for `fd`.
CAF_IO_EXPORT expected<int> send_buffer_size(native_socket fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment