[vlc-devel] [PATCH 2/5] configure: define socklen_t to int on OS/2

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 19 13:39:45 CET 2019


Hi,

On 2019-11-19 13:16, KO Myung-Hun wrote:
> OS/2 socket APIs use int not unsigned int in place of socklen_t. As
> a result, compilation is stopped at function call requiring socklen_t *
> because of type mismatch between int * and unsigned int *.
> ---
>   configure.ac | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index a53c9245af..184fa13ee7 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -756,7 +756,8 @@ ac_cv_type_socklen_t,
>   ac_cv_type_socklen_t=yes,
>   ac_cv_type_socklen_t=no)])
>   AS_IF([test "$ac_cv_type_socklen_t" = no],
> - [AC_DEFINE(socklen_t, unsigned int)])
> + [AS_CASE([${host_os}], [os2*],
> +          AC_DEFINE(socklen_t, int), AC_DEFINE(socklen_t, unsigned int))])

If socklen_t exists it should be detected and this code never called.

Also it may be better to use socklen_t where it's expected instead of 
using "unsigned int".

>   dnl Check for struct sockaddr_storage
>   AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
> -- 
> 2.22.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list