From 013bbe243dd0ef15c927886a43e2e3c54bb0ffdd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Sep 2022 18:23:20 +0200 Subject: [PATCH] Redo socklen_t on Windows without including --- libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h b/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h index c51a05e..11f200b 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/socklen_t.h @@ -22,8 +22,13 @@ # include /* If available, we do nothing. */ # elif defined(_WIN32) -# include - /* If available, we do nothing. */ + /* While socklen_t is declared in , including this header is + * hazardous due to it being sensitive to WIN32_LEAN_AND_MEAN (and who + * knows what else). At the same time, in both Platform SDK and MinGW, + * this is a simple int typedef and so just doing that feels like the + * simplest (if hackish) way to sidestep the whole mess. + */ + typedef int socklen_t; # else /* Else define it to unsigned int (suggested fallback by libevent). */ # define socklen_t unsigned int