[vlc-devel] [PATCH] configure: check socklen_t as int first

KO Myung-Hun komh78 at gmail.com
Sun Feb 23 11:49:43 CET 2020


Ping?

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 | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 7741ddca55..16eee78456 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -759,8 +759,22 @@ ac_cv_type_socklen_t,
>  #endif]], [[socklen_t len; len = 0;]])],
>  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_IF([test "$ac_cv_type_socklen_t" = no], [
> +  VLC_SAVE_FLAGS
> +  CFLAGS="-Wpointer-sign -Werror"
> +  AC_COMPILE_IFELSE([
> +    AC_LANG_PROGRAM([[
> +#include <sys/types.h>
> +#ifdef _WIN32
> +# include <winsock2.h>
> +# include <ws2tcpip.h>
> +#else
> +# include <sys/socket.h>
> +#endif
> +]], [[getpeername(0, 0, (int *)0);]])],
> +    AC_DEFINE(socklen_t, int), AC_DEFINE(socklen_t, unsigned int))
> +  VLC_RESTORE_FLAGS
> +])
>  
>  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

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.0.8 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.os2.kr/



More information about the vlc-devel mailing list