From 7a61f63b30eb60ca7ee791c6a85ca0ac241a76b6 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Sat, 4 Sep 2021 20:23:38 -0400 Subject: ffi: add socklen-t type. * ffi.c: Include if we HAVE_SOCKETS. (ffi_init_extra_types): Initialize socklen-t type if we HAVE_SOCKETS. * txr.1: Documented. * stdlib/doc-syms.tl: Updated. --- ffi.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ffi.c') diff --git a/ffi.c b/ffi.c index f115b3b5..6cbfe8c8 100644 --- a/ffi.c +++ b/ffi.c @@ -44,6 +44,9 @@ #if HAVE_SYS_TYPES_H #include #endif +#if HAVE_SOCKETS +#include +#endif #if HAVE_MMAP #include #include @@ -4669,6 +4672,12 @@ static void ffi_init_extra_types(void) ffi_typedef(intern(lit("uid-t"), user_package), type_by_size[convert(uid_t, -1) > 0][sizeof (uid_t)]); #endif + +#if HAVE_SOCKETS + ffi_typedef(intern(lit("socklen-t"), user_package), + type_by_size[convert(socklen_t, -1) > 0][sizeof (socklen_t)]); +#endif + ffi_typedef(intern(lit("longlong"), user_package), type_by_size[0][sizeof (long long)]); ffi_typedef(intern(lit("ulonglong"), user_package), -- cgit v1.2.3