fix sockaddr win32 and collapse headers on the unix side

pull/1276/head
Rick V 4 years ago
parent 759c0e6f31
commit 918a09c0cf

@ -1,6 +1,5 @@
#include <net/sock_addr.hpp>
#include <netinet/in.h>
#include <util/str.hpp>
#include <util/logging/logger.hpp>
#include <util/mem.hpp>
@ -8,8 +7,6 @@
#include <charconv>
#include <stdexcept>
#include <arpa/inet.h>
namespace llarp
{
/// shared utility functions

@ -1,6 +1,18 @@
#pragma once
#ifndef _WIN32
#include <netinet/in.h>
#include <arpa/inet.h>
#else
#include <winsock2.h>
#include <ws2tcpip.h>
#include <wspiapi.h>
extern "C" const char*
inet_ntop(int af, const void* src, char* dst, size_t size);
extern "C" int
inet_pton(int af, const char* src, void* dst);
#define inet_aton(x, y) inet_pton(AF_INET, x, y)
#endif
#include <string_view>
#include <string>

@ -5,8 +5,6 @@
#include <catch2/catch.hpp>
#include <arpa/inet.h>
TEST_CASE("SockAddr from IPv4", "[SockAddr]")
{
llarp::SockAddr addr(1, 2, 3, 4);

Loading…
Cancel
Save