Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1420,10 +1420,24 @@ esac AC_CHECK_HEADER(sys/socket.h, [ AC_DEFINE(OF_HAVE_SYS_SOCKET_H, 1, [Whether we have sys/socket.h]) + ]) + AC_CHECK_MEMBER([struct sockaddr_storage.ss_family], [ + AC_DEFINE(OF_HAVE_SOCKADDR_STORAGE, 1, + [Whether we have struct sockaddr_storage]) + ], [], [ + #ifdef OF_HAVE_SYS_TYPES_H + # include + #endif + #ifdef OF_HAVE_SYS_SOCKET_H + # include + #endif + #ifdef _WIN32 + # include + #endif ]) AC_CHECK_HEADER(netinet/in.h, [ AC_DEFINE(OF_HAVE_NETINET_IN_H, 1, [Whether we have netinet/in.h]) Index: src/OFSocket.h ================================================================== --- src/OFSocket.h +++ src/OFSocket.h @@ -185,10 +185,17 @@ struct sockaddr_in in; struct sockaddr_in6 in6; struct sockaddr_un un; struct sockaddr_ipx ipx; struct sockaddr_at at; +#ifdef OF_HAVE_SOCKADDR_STORAGE + /* + * Required to make the ABI stable in case we want to add more + * address types later. + */ + struct sockaddr_storage storage; +#endif } sockaddr; socklen_t length; } OFSocketAddress; #ifdef __cplusplus Index: src/objfw-defs.h.in ================================================================== --- src/objfw-defs.h.in +++ src/objfw-defs.h.in @@ -32,10 +32,11 @@ #undef OF_HAVE_PLUGINS #undef OF_HAVE_PTHREADS #undef OF_HAVE_PTHREAD_SPINLOCKS #undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES #undef OF_HAVE_SCHED_YIELD +#undef OF_HAVE_SOCKADDR_STORAGE #undef OF_HAVE_SOCKETS #undef OF_HAVE_STDNORETURN #undef OF_HAVE_SUBPROCESSES #undef OF_HAVE_SYMLINK #undef OF_HAVE_SYNC_BUILTINS