Permalink
Browse files

Fix openbsd build: AI_V4MAPPED, AI_ALL not defined

  • Loading branch information...
devnexen authored and nikic committed Mar 25, 2017
1 parent 1ff85df commit 93d7cf375e53d2f0af31dd47af6df803f8e68c65
Showing with 17 additions and 0 deletions.
  1. +13 −0 ext/sockets/config.m4
  2. +4 −0 ext/sockets/sockets.c
View
@@ -56,6 +56,19 @@ if test "$PHP_SOCKETS" != "no"; then
AC_DEFINE(HAVE_AI_V4MAPPED,1,[Whether you have AI_V4MAPPED])
fi
dnl Check for AI_ALL flag
AC_CACHE_CHECK([if getaddrinfo supports AI_ALL],[ac_cv_gai_ai_all],
[
AC_TRY_COMPILE([
#include <netdb.h>
], [int flag = AI_ALL;],
ac_cv_gai_ai_all=yes, ac_cv_gai_ai_all=no)
])
if test "$ac_cv_gai_ai_all" = yes; then
AC_DEFINE(HAVE_AI_ALL,1,[Whether you have AI_ALL])
fi
PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared],, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
fi
View
@@ -789,8 +789,12 @@ static PHP_MINIT_FUNCTION(sockets)
REGISTER_LONG_CONSTANT("AI_PASSIVE", AI_PASSIVE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("AI_CANONNAME", AI_CANONNAME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("AI_NUMERICHOST", AI_NUMERICHOST, CONST_CS | CONST_PERSISTENT);
#if HAVE_AI_V4MAPPED
REGISTER_LONG_CONSTANT("AI_V4MAPPED", AI_V4MAPPED, CONST_CS | CONST_PERSISTENT);
#endif
#if HAVE_AI_ALL
REGISTER_LONG_CONSTANT("AI_ALL", AI_ALL, CONST_CS | CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("AI_ADDRCONFIG", AI_ADDRCONFIG, CONST_CS | CONST_PERSISTENT);
#ifdef __USE_GNU
REGISTER_LONG_CONSTANT("AI_IDN", AI_IDN, CONST_CS | CONST_PERSISTENT);

0 comments on commit 93d7cf3

Please sign in to comment.