From: Hugo Landau Date: Fri, 24 Nov 2023 10:03:30 +0000 (+0000) Subject: Only include winsock2.h for struct timeval if needed X-Git-Tag: openssl-3.3.0-alpha1~567 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0e9d0370262ade64c55f2385fbb09ec6aa81e76;p=thirdparty%2Fopenssl.git Only include winsock2.h for struct timeval if needed Fixes #22811 Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Matthias St. Pierre (Merged from https://github.com/openssl/openssl/pull/22813) (cherry picked from commit ba58e9f1e22dd9ee2e37078640dcbe9f520a555d) --- diff --git a/include/openssl/e_ostime.h b/include/openssl/e_ostime.h index 8a7cc9880fa..0e174875049 100644 --- a/include/openssl/e_ostime.h +++ b/include/openssl/e_ostime.h @@ -22,7 +22,15 @@ */ # if defined(OPENSSL_SYS_WINDOWS) -# include +# if !defined(_WINSOCKAPI_) + /* + * winsock2.h defines _WINSOCK2API_ and both winsock2.h and winsock.h define + * _WINSOCKAPI_. Both of these provide struct timeval. Don't include + * winsock2.h if either header has been included to avoid breakage with + * applications that prefer to use over . + */ +# include +# endif # else # include # endif