Index: Doxyfile ================================================================== --- Doxyfile +++ Doxyfile @@ -21,11 +21,10 @@ OF_FILE_MANAGER_SUPPORTS_PERMISSIONS \ OF_FILE_MANAGER_SUPPORTS_SYMLINKS \ OF_GENERIC(...)= \ OF_HAVE_BLOCKS \ OF_HAVE_FILES \ - OF_HAVE_GETIFADDRS \ OF_HAVE_SANDBOX \ OF_HAVE_SOCKETS \ OF_HAVE_THREADS \ OF_KINDOF(...)= \ OF_NO_RETURN= \ @@ -36,13 +35,14 @@ OF_RETURNS_INNER_POINTER= \ OF_RETURNS_NOT_RETAINED= \ OF_RETURNS_RETAINED= \ OF_ROOT_CLASS= \ OF_SENTINEL= \ + OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES \ OF_WARN_UNUSED_RESULT= \ OF_WEAK_UNAVAILABLE= \ SIGHUP \ SIGUSR1 \ SIGUSR2 MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES IGNORE_PREFIX = OF of_ Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1763,11 +1763,12 @@ ;; esac AC_CHECK_HEADERS(ifaddrs.h netpacket/packet.h) AC_CHECK_FUNC(getifaddrs, [ - AC_DEFINE(OF_HAVE_GETIFADDRS, 1, [Whether we have getifaddrs()]) + AC_DEFINE(OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES, 1, + [Whether OFSystemInfo has network interfaces]) ]) AC_CHECK_TYPES([struct sockaddr_ll], [], [], [ #ifdef HAVE_NETPACKET_PACKET_H # include #endif Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -19,11 +19,11 @@ OF_ASSUME_NONNULL_BEGIN @class OFDictionary OF_GENERIC(KeyType, ObjectType); @class OFIRI; -#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_GETIFADDRS) +#ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES /** * @brief A key in the per-interface dictionary returned by * @ref networkInterfaces. * * Possible keys are: @@ -88,11 +88,11 @@ @property (class, readonly, nonatomic) bool supportsAltiVec; # endif # ifdef OF_WINDOWS @property (class, readonly, nonatomic, getter=isWindowsNT) bool windowsNT; # endif -# if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_GETIFADDRS) +# ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES @property (class, readonly, nonatomic) OFDictionary OF_GENERIC(OFString *, OFDictionary OF_GENERIC(OFNetworkInterfaceInfoKey, id) *) *networkInterfaces; # endif #endif @@ -369,11 +369,11 @@ * @return Whether the application is running on Windows NT */ + (bool)isWindowsNT; #endif -#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_GETIFADDRS) +#ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES /** * @brief Returns the available (though not necessarily configured) network * interfaces and information about them. * * @return The available network interfaces and information about them Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -122,11 +122,11 @@ struct X86Regs { uint32_t eax, ebx, ecx, edx; }; #endif -#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_GETIFADDRS) +#ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES OFConstantString *const OFNetworkInterfaceAddresses = @"OFNetworkInterfaceAddresses"; OFConstantString *const OFNetworkInterfaceEthernetAddress = @"OFNetworkInterfaceEthernetAddress"; #endif @@ -836,11 +836,11 @@ { return !(GetVersion() & 0x80000000); } #endif -#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_GETIFADDRS) +#ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES static OFSocketAddress wrapSockaddr(struct sockaddr *sa) { OFSocketAddress address; Index: src/objfw-defs.h.in ================================================================== --- src/objfw-defs.h.in +++ src/objfw-defs.h.in @@ -12,11 +12,10 @@ #undef OF_HAVE_BUILTIN_BSWAP64 #undef OF_HAVE_CHMOD #undef OF_HAVE_CHOWN #undef OF_HAVE_FILES #undef OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR -#undef OF_HAVE_GETIFADDRS #undef OF_HAVE_IPV6 #undef OF_HAVE_IPX #undef OF_HAVE_LIMITS_H #undef OF_HAVE_LINK #undef OF_HAVE_MAX_ALIGN_T @@ -51,8 +50,9 @@ #undef OF_NINTENDO_3DS #undef OF_NINTENDO_DS #undef OF_NINTENDO_SWITCH #undef OF_NO_SHARED #undef OF_OBJFW_RUNTIME +#undef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES #undef OF_UNIVERSAL #undef OF_WII #undef OF_WII_U Index: tests/OFSystemInfoTests.m ================================================================== --- tests/OFSystemInfoTests.m +++ tests/OFSystemInfoTests.m @@ -104,9 +104,15 @@ #ifdef OF_POWERPC [OFStdOut writeFormat: @"[OFSystemInfo] Supports AltiVec: %d\n", [OFSystemInfo supportsAltiVec]]; #endif + +#ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES + [OFStdOut writeFormat: @"[OFSystemInfo] Network interfaces: %@\n", + [[[OFSystemInfo networkInterfaces] allKeys] + componentsJoinedByString: @", "]]; +#endif objc_autoreleasePoolPop(pool); } @end