diff --git a/src/usocket.h b/src/usocket.h index 54a4ffc..ef7ace0 100644 --- a/src/usocket.h +++ b/src/usocket.h @@ -29,12 +29,26 @@ #include /* TCP options (nagle algorithm disable) */ #include +#ifndef PSP #include - +#else #ifndef HAVE_GETADDRINFO #include "getaddrinfo.h" #endif +/* Replacement for sockaddr storage that we can use internally on platforms + * that lack it. It is not space-efficient, but neither is sockaddr_storage. + */ +struct sockaddr_storage { + union { + struct sockaddr ss_sa; + struct sockaddr_in ss_sin; + struct sockaddr_in6 ss_sin6; + char ss_padding[128]; + } ss_union; +}; +#endif + #ifndef SO_REUSEPORT #define SO_REUSEPORT SO_REUSEADDR #endif