annotate DEPENDENCIES/generic/include/boost/asio/detail/old_win_sdk_compat.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 //
Chris@16 2 // detail/old_win_sdk_compat.hpp
Chris@16 3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chris@16 4 //
Chris@101 5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
Chris@16 6 //
Chris@16 7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 9 //
Chris@16 10
Chris@16 11 #ifndef BOOST_ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP
Chris@16 12 #define BOOST_ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP
Chris@16 13
Chris@16 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
Chris@16 15 # pragma once
Chris@16 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
Chris@16 17
Chris@16 18 #include <boost/asio/detail/config.hpp>
Chris@16 19
Chris@16 20 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
Chris@16 21
Chris@16 22 // Guess whether we are building against on old Platform SDK.
Chris@16 23 #if !defined(IN6ADDR_ANY_INIT)
Chris@16 24 #define BOOST_ASIO_HAS_OLD_WIN_SDK 1
Chris@16 25 #endif // !defined(IN6ADDR_ANY_INIT)
Chris@16 26
Chris@16 27 #if defined(BOOST_ASIO_HAS_OLD_WIN_SDK)
Chris@16 28
Chris@16 29 // Emulation of types that are missing from old Platform SDKs.
Chris@16 30 //
Chris@16 31 // N.B. this emulation is also used if building for a Windows 2000 target with
Chris@16 32 // a recent (i.e. Vista or later) SDK, as the SDK does not provide IPv6 support
Chris@16 33 // in that case.
Chris@16 34
Chris@16 35 #include <boost/asio/detail/push_options.hpp>
Chris@16 36
Chris@16 37 namespace boost {
Chris@16 38 namespace asio {
Chris@16 39 namespace detail {
Chris@16 40
Chris@16 41 enum
Chris@16 42 {
Chris@16 43 sockaddr_storage_maxsize = 128, // Maximum size.
Chris@16 44 sockaddr_storage_alignsize = (sizeof(__int64)), // Desired alignment.
Chris@16 45 sockaddr_storage_pad1size = (sockaddr_storage_alignsize - sizeof(short)),
Chris@16 46 sockaddr_storage_pad2size = (sockaddr_storage_maxsize -
Chris@16 47 (sizeof(short) + sockaddr_storage_pad1size + sockaddr_storage_alignsize))
Chris@16 48 };
Chris@16 49
Chris@16 50 struct sockaddr_storage_emulation
Chris@16 51 {
Chris@16 52 short ss_family;
Chris@16 53 char __ss_pad1[sockaddr_storage_pad1size];
Chris@16 54 __int64 __ss_align;
Chris@16 55 char __ss_pad2[sockaddr_storage_pad2size];
Chris@16 56 };
Chris@16 57
Chris@16 58 struct in6_addr_emulation
Chris@16 59 {
Chris@16 60 union
Chris@16 61 {
Chris@16 62 u_char Byte[16];
Chris@16 63 u_short Word[8];
Chris@16 64 } u;
Chris@16 65 };
Chris@16 66
Chris@16 67 #if !defined(s6_addr)
Chris@16 68 # define _S6_un u
Chris@16 69 # define _S6_u8 Byte
Chris@16 70 # define s6_addr _S6_un._S6_u8
Chris@16 71 #endif // !defined(s6_addr)
Chris@16 72
Chris@16 73 struct sockaddr_in6_emulation
Chris@16 74 {
Chris@16 75 short sin6_family;
Chris@16 76 u_short sin6_port;
Chris@16 77 u_long sin6_flowinfo;
Chris@16 78 in6_addr_emulation sin6_addr;
Chris@16 79 u_long sin6_scope_id;
Chris@16 80 };
Chris@16 81
Chris@16 82 struct ipv6_mreq_emulation
Chris@16 83 {
Chris@16 84 in6_addr_emulation ipv6mr_multiaddr;
Chris@16 85 unsigned int ipv6mr_interface;
Chris@16 86 };
Chris@16 87
Chris@16 88 struct addrinfo_emulation
Chris@16 89 {
Chris@16 90 int ai_flags;
Chris@16 91 int ai_family;
Chris@16 92 int ai_socktype;
Chris@16 93 int ai_protocol;
Chris@16 94 size_t ai_addrlen;
Chris@16 95 char* ai_canonname;
Chris@16 96 sockaddr* ai_addr;
Chris@16 97 addrinfo_emulation* ai_next;
Chris@16 98 };
Chris@16 99
Chris@16 100 #if !defined(AI_PASSIVE)
Chris@16 101 # define AI_PASSIVE 0x1
Chris@16 102 #endif
Chris@16 103
Chris@16 104 #if !defined(AI_CANONNAME)
Chris@16 105 # define AI_CANONNAME 0x2
Chris@16 106 #endif
Chris@16 107
Chris@16 108 #if !defined(AI_NUMERICHOST)
Chris@16 109 # define AI_NUMERICHOST 0x4
Chris@16 110 #endif
Chris@16 111
Chris@16 112 #if !defined(EAI_AGAIN)
Chris@16 113 # define EAI_AGAIN WSATRY_AGAIN
Chris@16 114 #endif
Chris@16 115
Chris@16 116 #if !defined(EAI_BADFLAGS)
Chris@16 117 # define EAI_BADFLAGS WSAEINVAL
Chris@16 118 #endif
Chris@16 119
Chris@16 120 #if !defined(EAI_FAIL)
Chris@16 121 # define EAI_FAIL WSANO_RECOVERY
Chris@16 122 #endif
Chris@16 123
Chris@16 124 #if !defined(EAI_FAMILY)
Chris@16 125 # define EAI_FAMILY WSAEAFNOSUPPORT
Chris@16 126 #endif
Chris@16 127
Chris@16 128 #if !defined(EAI_MEMORY)
Chris@16 129 # define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY
Chris@16 130 #endif
Chris@16 131
Chris@16 132 #if !defined(EAI_NODATA)
Chris@16 133 # define EAI_NODATA WSANO_DATA
Chris@16 134 #endif
Chris@16 135
Chris@16 136 #if !defined(EAI_NONAME)
Chris@16 137 # define EAI_NONAME WSAHOST_NOT_FOUND
Chris@16 138 #endif
Chris@16 139
Chris@16 140 #if !defined(EAI_SERVICE)
Chris@16 141 # define EAI_SERVICE WSATYPE_NOT_FOUND
Chris@16 142 #endif
Chris@16 143
Chris@16 144 #if !defined(EAI_SOCKTYPE)
Chris@16 145 # define EAI_SOCKTYPE WSAESOCKTNOSUPPORT
Chris@16 146 #endif
Chris@16 147
Chris@16 148 #if !defined(NI_NOFQDN)
Chris@16 149 # define NI_NOFQDN 0x01
Chris@16 150 #endif
Chris@16 151
Chris@16 152 #if !defined(NI_NUMERICHOST)
Chris@16 153 # define NI_NUMERICHOST 0x02
Chris@16 154 #endif
Chris@16 155
Chris@16 156 #if !defined(NI_NAMEREQD)
Chris@16 157 # define NI_NAMEREQD 0x04
Chris@16 158 #endif
Chris@16 159
Chris@16 160 #if !defined(NI_NUMERICSERV)
Chris@16 161 # define NI_NUMERICSERV 0x08
Chris@16 162 #endif
Chris@16 163
Chris@16 164 #if !defined(NI_DGRAM)
Chris@16 165 # define NI_DGRAM 0x10
Chris@16 166 #endif
Chris@16 167
Chris@16 168 #if !defined(IPPROTO_IPV6)
Chris@16 169 # define IPPROTO_IPV6 41
Chris@16 170 #endif
Chris@16 171
Chris@16 172 #if !defined(IPV6_UNICAST_HOPS)
Chris@16 173 # define IPV6_UNICAST_HOPS 4
Chris@16 174 #endif
Chris@16 175
Chris@16 176 #if !defined(IPV6_MULTICAST_IF)
Chris@16 177 # define IPV6_MULTICAST_IF 9
Chris@16 178 #endif
Chris@16 179
Chris@16 180 #if !defined(IPV6_MULTICAST_HOPS)
Chris@16 181 # define IPV6_MULTICAST_HOPS 10
Chris@16 182 #endif
Chris@16 183
Chris@16 184 #if !defined(IPV6_MULTICAST_LOOP)
Chris@16 185 # define IPV6_MULTICAST_LOOP 11
Chris@16 186 #endif
Chris@16 187
Chris@16 188 #if !defined(IPV6_JOIN_GROUP)
Chris@16 189 # define IPV6_JOIN_GROUP 12
Chris@16 190 #endif
Chris@16 191
Chris@16 192 #if !defined(IPV6_LEAVE_GROUP)
Chris@16 193 # define IPV6_LEAVE_GROUP 13
Chris@16 194 #endif
Chris@16 195
Chris@16 196 } // namespace detail
Chris@16 197 } // namespace asio
Chris@16 198 } // namespace boost
Chris@16 199
Chris@16 200 #include <boost/asio/detail/pop_options.hpp>
Chris@16 201
Chris@16 202 #endif // defined(BOOST_ASIO_HAS_OLD_WIN_SDK)
Chris@16 203
Chris@16 204 // Even newer Platform SDKs that support IPv6 may not define IPV6_V6ONLY.
Chris@16 205 #if !defined(IPV6_V6ONLY)
Chris@16 206 # define IPV6_V6ONLY 27
Chris@16 207 #endif
Chris@16 208
Chris@16 209 // Some SDKs (e.g. Windows CE) don't define IPPROTO_ICMPV6.
Chris@16 210 #if !defined(IPPROTO_ICMPV6)
Chris@16 211 # define IPPROTO_ICMPV6 58
Chris@16 212 #endif
Chris@16 213
Chris@16 214 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
Chris@16 215
Chris@16 216 #endif // BOOST_ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP