Opened 14 years ago

Closed 13 years ago

#2593 closed Bugs (invalid)

asio missing IPPROTO_IPV6 for win2k and older targets

Reported by: Joey Liaw <joeyliaw@…> Owned by: chris_kohlhoff
Milestone: Boost 1.38.0 Component: asio
Version: Boost 1.37.0 Severity: Problem
Keywords: IPPROTO_IPV6 Cc:

Description

When building against Vista SDK headers, if the windows version target _WIN32_WINNT is defined to be 0x0500 (win2k) or less, IPPROTO_IPV6 is not included in the enum in ws2def.h, giving the error:

boost/asio/detail/socket_ops.hpp(407) : error C2065: 'IPPROTO_IPV6' : undeclared identifier

Since this is the only header which references IPPROTO_IPV6, a possible workaround would be to stick at the top of the header:

When target is Windows 2000 or earlier, Microsoft's ws2def.h does not enumerate IPPROTO_IPV6.

#if defined(BOOST_WINDOWS)
defined(CYGWIN)

# if defined(_WIN32_WINNT) && (_WIN32_WINNT <= 0x0500) # define IPPROTO_IPV6 41 # endif _WIN32_WINNT

#endif
defined(BOOST_WINDOWS) defined(CYGWIN)

Change History (2)

comment:1 by Joey Liaw <joeyliaw@…>, 14 years ago

This is what I get for not previewing the formatting.

// When target is Windows 2000 or earlier, Microsoft's ws2def.h does not
// enumerate IPPROTO_IPV6.
#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
# if defined(_WIN32_WINNT) && (_WIN32_WINNT <= 0x0500)
#   define IPPROTO_IPV6 41
# endif  // _WIN32_WINNT
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)

comment:2 by chris_kohlhoff, 13 years ago

Resolution: invalid
Status: newclosed

I cannot reproduce any problem using the v6.0A Windows SDK (which I presume is the Vista SDK"). When I define _WIN32_WINNT to 0x500, the existing emulation in boost/asio/detail/old_win_sdk_compat.hpp is used.

Note: See TracTickets for help on using tickets.