From: sashan Date: Fri, 22 Mar 2024 14:19:53 +0000 (+0100) Subject: fix demos/sslecho/main.c so it builds on OpenBSD too X-Git-Tag: openssl-3.1.6~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a3f1a2ba890271d94f550a893bb136beeb38b72;p=thirdparty%2Fopenssl.git fix demos/sslecho/main.c so it builds on OpenBSD too trying to build `demos/sslecho/main.c` shipped by current openssl fails with error as follows: ``` cc -I../../include -g -Wall -c -o main.o main.c main.c:35:24: error: variable has incomplete type 'struct sockaddr_in' struct sockaddr_in addr; ^ main.c:35:12: note: forward declaration of 'struct sockaddr_in' struct sockaddr_in addr; ^ main.c:46:32: error: use of undeclared identifier 'INADDR_ANY' addr.sin_addr.s_addr = INADDR_ANY; ^ main.c:152:24: error: variable has incomplete type 'struct sockaddr_in' struct sockaddr_in addr; ^ main.c:152:12: note: forward declaration of 'struct sockaddr_in' struct sockaddr_in addr; ^ 3 errors generated. gmake: *** [: main.o] Error 1 ``` including `netinet/in.h` fixes the build Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/23936) (cherry picked from commit 01eaf203856bfbb63051f8ecf56eae2d21132496) --- diff --git a/demos/sslecho/main.c b/demos/sslecho/main.c index a70d2c47251..7beb1e90956 100644 --- a/demos/sslecho/main.c +++ b/demos/sslecho/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include