From 9226c6b4fd6efaf043563c1ffe37b5a967f4682b Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 22 Sep 2023 17:37:28 -0400 Subject: Build fixes for Haiku. diff --git a/libdnet-stripped/include/dnet/route.h b/libdnet-stripped/include/dnet/route.h index b4bd4cc..2095151 100644 --- a/libdnet-stripped/include/dnet/route.h +++ b/libdnet-stripped/include/dnet/route.h @@ -14,6 +14,9 @@ /* * Routing table entry */ +#ifdef __HAIKU__ +#define route_entry dnet_route_entry +#endif struct route_entry { char intf_name[INTF_NAME_LEN]; /* interface name */ struct addr route_dst; /* destination address */ diff --git a/libdnet-stripped/src/addr.c b/libdnet-stripped/src/addr.c index 7008966..628cc19 100644 --- a/libdnet-stripped/src/addr.c +++ b/libdnet-stripped/src/addr.c @@ -319,12 +319,14 @@ addr_ston(const struct sockaddr *sa, struct addr *a) # endif #endif case AF_UNSPEC: +#ifndef __HAIKU__ case ARP_HRD_ETH: /* XXX- Linux arp(7) */ case ARP_HRD_APPLETALK: /* AppleTalk DDP */ case ARP_HRD_INFINIBAND: /* InfiniBand */ case ARP_HDR_IEEE80211: /* IEEE 802.11 */ case ARP_HRD_IEEE80211_PRISM: /* IEEE 802.11 + prism header */ case ARP_HRD_IEEE80211_RADIOTAP: /* IEEE 802.11 + radiotap header */ +#endif a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, sa->sa_data, ETH_ADDR_LEN); diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index ff7279e..4e05237 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -130,7 +130,12 @@ typedef unsigned __int8 u_int8_t; #include #define NETINET_IP_H #endif + +#ifndef __HAIKU__ #include +#else +#define ARPHRD_ETHER 1 /* ethernet hardware format */ +#endif #if HAVE_SYS_RESOURCE_H #include diff --git a/ncat/sockaddr_u.h b/ncat/sockaddr_u.h index 069e2c2..353b00a 100644 --- a/ncat/sockaddr_u.h +++ b/ncat/sockaddr_u.h @@ -74,6 +74,11 @@ #endif #if HAVE_SYS_UN_H # include + +#ifndef SUN_LEN +#define SUN_LEN(ptr) ((sizeof(*(ptr)) - sizeof((ptr)->sun_path)) \ + + strlen((ptr)->sun_path)) +#endif #endif #if HAVE_LINUX_VM_SOCKETS_H #include diff --git a/struct_ip.h b/struct_ip.h index 34c2602..cd47296 100644 --- a/struct_ip.h +++ b/struct_ip.h @@ -50,7 +50,9 @@ typedef unsigned __int8 u_int8_t; #include #define NETINET_IP_H #endif +#ifndef __HAIKU__ #include +#endif #ifndef WIN32 #include -- 2.37.3