ObjFW  Diff

Differences From Artifact [88309917a4]:

To Artifact [91568c0543]:


25
26
27
28
29
30
31













32
33
34
35
36
37
38

#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif
#if defined(OF_MACOS) || defined(OF_IOS) || defined(OF_NETBSD)
# include <sys/sysctl.h>
#endif














#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <exec/execbase.h>
# include <proto/exec.h>
# undef Class
#endif







>
>
>
>
>
>
>
>
>
>
>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif
#if defined(OF_MACOS) || defined(OF_IOS) || defined(OF_NETBSD)
# include <sys/sysctl.h>
#endif

#ifdef HAVE_IFADDRS_H
# include <ifaddrs.h>
#endif
#ifdef HAVE_NET_IF_TYPES_H
# include <net/if_types.h>
#endif
#ifdef HAVE_NET_IF_DL_H
# include <net/if_dl.h>
#endif
#ifdef HAVE_NETPACKET_PACKET_H
# include <netpacket/packet.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <exec/execbase.h>
# include <proto/exec.h>
# undef Class
#endif
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# include <sys/syspage.h>
#endif

#if !defined(PATH_MAX) && defined(MAX_PATH)
# define PATH_MAX MAX_PATH
#endif

#ifdef HAVE_IFADDRS_H
# include <ifaddrs.h>
#endif
#ifdef HAVE_NETPACKET_PACKET_H
# include <netpacket/packet.h>
#endif

#if defined(OF_MACOS) || defined(OF_IOS)
/*
 * These have been dropped from newer iOS SDKs, however, their replacements are
 * not available on iOS < 10. This means it's impossible to search for the
 * paths when using a new SDK while targeting iOS 9 or earlier. To work around
 * this, we define those manually, only to be used when the replacements are
 * not available at runtime.







<
<
<
<
<
<
<







94
95
96
97
98
99
100







101
102
103
104
105
106
107
# include <sys/syspage.h>
#endif

#if !defined(PATH_MAX) && defined(MAX_PATH)
# define PATH_MAX MAX_PATH
#endif








#if defined(OF_MACOS) || defined(OF_IOS)
/*
 * These have been dropped from newer iOS SDKs, however, their replacements are
 * not available on iOS < 10. This means it's impossible to search for the
 * paths when using a new SDK while targeting iOS 9 or earlier. To work around
 * this, we define those manually, only to be used when the replacements are
 * not available at runtime.
924
925
926
927
928
929
930


















931
932
933
934
935
936
937
					continue;

				addr = [OFData dataWithItems: sll->sll_addr
						       count: sll->sll_halen];
				[interface setObject: addr forKey: key];
				continue;
			}


















# endif

			addresses = [interface
			    objectForKey: OFNetworkInterfaceAddresses];
			if (addresses == nil) {
				addresses = [OFMutableData
				    dataWithItemSize: sizeof(OFSocketAddress)];







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
					continue;

				addr = [OFData dataWithItems: sll->sll_addr
						       count: sll->sll_halen];
				[interface setObject: addr forKey: key];
				continue;
			}
# endif
# if defined(HAVE_STRUCT_SOCKADDR_DL) && defined(AF_LINK) && \
    defined(IFT_ETHER) && defined(LLADDR)
			if (iter->ifa_addr->sa_family == AF_LINK) {
				const OFNetworkInterfaceInfoKey key =
				    OFNetworkInterfaceEthernetAddress;
				struct sockaddr_dl *sdl = (struct sockaddr_dl *)
				    (void *)iter->ifa_addr;
				OFData *addr;

				if (sdl->sdl_type != IFT_ETHER)
					continue;

				addr = [OFData dataWithItems: LLADDR(sdl)
						       count: sdl->sdl_alen];
				[interface setObject: addr forKey: key];
				continue;
			}
# endif

			addresses = [interface
			    objectForKey: OFNetworkInterfaceAddresses];
			if (addresses == nil) {
				addresses = [OFMutableData
				    dataWithItemSize: sizeof(OFSocketAddress)];