Branch: Tag:

2014-12-04

2014-12-04 19:24:13 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stdio: Some system header files hide IPPROTO_IPV6 in an enum.

The WIN32 SDK 6.0 ws2def.h header file hides the symbol
IPPROTO_IPV6 in an anonymous enum typedefed to IPPROTO.

Improves support for IPv6 on WIN32.

69:    inet_ntop execve listxattr flistxattr getxattr fgetxattr setxattr fsetxattr \    fdopendir pathconf fpathconf dirfd fstatat openat unlinkat kqueue)    + AC_MSG_CHECKING([whether IPPROTO_IPV6 exists]) + AC_CACHE_VAL(pike_cv_have_IPPROTO_IPV6, [ +  AC_TRY_COMPILE([ + // The WIN32 SDK hides the symbol if the API level is not at least 5.2. + #define WIN32 100 + #define _WIN32_WINDOWS 0x05ff + #define _WIN32_WINNT 0x05ff + #define NTDDI_VERSION 0x05ffffff + #define WIN32_LEAN_AND_MEAN +  + #define _GNU_SOURCE + #ifdef HAVE_WINSOCK2_H + #include <winsock2.h> + #endif + #ifdef HAVE_SYS_TYPES_H + #include <sys/types.h> + #endif + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif +  ], [ +  int val = IPPROTO_IPV6; +  ], [ +  pike_cv_have_IPPROTO_IPV6=yes +  ], [ +  pike_cv_have_IPPROTO_IPV6=no +  ]) + ]) + if test "x$pike_cv_have_IPPROTO_IPV6" = "xyes"; then +  AC_MSG_RESULT(yes) +  AC_DEFINE(HAVE_IPPROTO_IPV6) + else +  AC_MSG_RESULT(no) + fi +    dnl AC_HAVE_FUNCS(libzfs_init zfs_path_to_zhandle)      define(PIKE_CHECK_ZFS_ENUM, [