config.hpp 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397
  1. //
  2. // detail/config.hpp
  3. // ~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef BOOST_ASIO_DETAIL_CONFIG_HPP
  11. #define BOOST_ASIO_DETAIL_CONFIG_HPP
  12. #if defined(BOOST_ASIO_STANDALONE)
  13. # define BOOST_ASIO_DISABLE_BOOST_ALIGN 1
  14. # define BOOST_ASIO_DISABLE_BOOST_ARRAY 1
  15. # define BOOST_ASIO_DISABLE_BOOST_ASSERT 1
  16. # define BOOST_ASIO_DISABLE_BOOST_BIND 1
  17. # define BOOST_ASIO_DISABLE_BOOST_CHRONO 1
  18. # define BOOST_ASIO_DISABLE_BOOST_DATE_TIME 1
  19. # define BOOST_ASIO_DISABLE_BOOST_LIMITS 1
  20. # define BOOST_ASIO_DISABLE_BOOST_REGEX 1
  21. # define BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT 1
  22. # define BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
  23. # define BOOST_ASIO_DISABLE_BOOST_WORKAROUND 1
  24. #else // defined(BOOST_ASIO_STANDALONE)
  25. // Boost.Config library is available.
  26. # include <boost/config.hpp>
  27. # include <boost/version.hpp>
  28. # define BOOST_ASIO_HAS_BOOST_CONFIG 1
  29. #endif // defined(BOOST_ASIO_STANDALONE)
  30. // Default to a header-only implementation. The user must specifically request
  31. // separate compilation by defining either BOOST_ASIO_SEPARATE_COMPILATION or
  32. // BOOST_ASIO_DYN_LINK (as a DLL/shared library implies separate compilation).
  33. #if !defined(BOOST_ASIO_HEADER_ONLY)
  34. # if !defined(BOOST_ASIO_SEPARATE_COMPILATION)
  35. # if !defined(BOOST_ASIO_DYN_LINK)
  36. # define BOOST_ASIO_HEADER_ONLY 1
  37. # endif // !defined(BOOST_ASIO_DYN_LINK)
  38. # endif // !defined(BOOST_ASIO_SEPARATE_COMPILATION)
  39. #endif // !defined(BOOST_ASIO_HEADER_ONLY)
  40. #if defined(BOOST_ASIO_HEADER_ONLY)
  41. # define BOOST_ASIO_DECL inline
  42. #else // defined(BOOST_ASIO_HEADER_ONLY)
  43. # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
  44. // We need to import/export our code only if the user has specifically asked
  45. // for it by defining BOOST_ASIO_DYN_LINK.
  46. # if defined(BOOST_ASIO_DYN_LINK)
  47. // Export if this is our own source, otherwise import.
  48. # if defined(BOOST_ASIO_SOURCE)
  49. # define BOOST_ASIO_DECL __declspec(dllexport)
  50. # else // defined(BOOST_ASIO_SOURCE)
  51. # define BOOST_ASIO_DECL __declspec(dllimport)
  52. # endif // defined(BOOST_ASIO_SOURCE)
  53. # endif // defined(BOOST_ASIO_DYN_LINK)
  54. # endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
  55. #endif // defined(BOOST_ASIO_HEADER_ONLY)
  56. // If BOOST_ASIO_DECL isn't defined yet define it now.
  57. #if !defined(BOOST_ASIO_DECL)
  58. # define BOOST_ASIO_DECL
  59. #endif // !defined(BOOST_ASIO_DECL)
  60. // Helper macro for documentation.
  61. #define BOOST_ASIO_UNSPECIFIED(e) e
  62. // Microsoft Visual C++ detection.
  63. #if !defined(BOOST_ASIO_MSVC)
  64. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
  65. # define BOOST_ASIO_MSVC BOOST_MSVC
  66. # elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \
  67. || (!defined(__MWERKS__) && !defined(__EDG_VERSION__)))
  68. # define BOOST_ASIO_MSVC _MSC_VER
  69. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
  70. #endif // !defined(BOOST_ASIO_MSVC)
  71. // Clang / libc++ detection.
  72. #if defined(__clang__)
  73. # if (__cplusplus >= 201103)
  74. # if __has_include(<__config>)
  75. # include <__config>
  76. # if defined(_LIBCPP_VERSION)
  77. # define BOOST_ASIO_HAS_CLANG_LIBCXX 1
  78. # endif // defined(_LIBCPP_VERSION)
  79. # endif // __has_include(<__config>)
  80. # endif // (__cplusplus >= 201103)
  81. #endif // defined(__clang__)
  82. // Android platform detection.
  83. #if defined(__ANDROID__)
  84. # include <android/api-level.h>
  85. #endif // defined(__ANDROID__)
  86. // Always enabled. Retained for backwards compatibility in user code.
  87. #if !defined(BOOST_ASIO_DISABLE_CXX11_MACROS)
  88. # define BOOST_ASIO_HAS_MOVE 1
  89. # define BOOST_ASIO_MOVE_ARG(type) type&&
  90. # define BOOST_ASIO_MOVE_ARG2(type1, type2) type1, type2&&
  91. # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) type&
  92. # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
  93. # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
  94. # define BOOST_ASIO_MOVE_OR_LVALUE(type) static_cast<type&&>
  95. # define BOOST_ASIO_MOVE_OR_LVALUE_ARG(type) type&&
  96. # define BOOST_ASIO_MOVE_OR_LVALUE_TYPE(type) type
  97. # define BOOST_ASIO_DELETED = delete
  98. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  99. # define BOOST_ASIO_HAS_CONSTEXPR 1
  100. # define BOOST_ASIO_STATIC_CONSTEXPR(type, assignment) \
  101. static constexpr type assignment
  102. # define BOOST_ASIO_HAS_NOEXCEPT 1
  103. # define BOOST_ASIO_NOEXCEPT noexcept(true)
  104. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
  105. # define BOOST_ASIO_NOEXCEPT_IF(c) noexcept(c)
  106. # define BOOST_ASIO_HAS_DECLTYPE 1
  107. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX(t) auto
  108. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX2(t0, t1) auto
  109. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX3(t0, t1, t2) auto
  110. # define BOOST_ASIO_AUTO_RETURN_TYPE_SUFFIX(expr) -> decltype expr
  111. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  112. # define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
  113. # define BOOST_ASIO_HAS_ENUM_CLASS 1
  114. # define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
  115. # define BOOST_ASIO_LVALUE_REF_QUAL &
  116. # define BOOST_ASIO_RVALUE_REF_QUAL &&
  117. # define BOOST_ASIO_HAS_USER_DEFINED_LITERALS 1
  118. # define BOOST_ASIO_HAS_ALIGNOF 1
  119. # define BOOST_ASIO_ALIGNOF(T) alignof(T)
  120. # define BOOST_ASIO_HAS_STD_ALIGN 1
  121. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  122. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  123. # define BOOST_ASIO_HAS_STD_ARRAY 1
  124. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  125. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  126. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  127. # define BOOST_ASIO_HAS_STD_CHRONO 1
  128. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  129. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  130. # define BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER 1
  131. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  132. # define BOOST_ASIO_HAS_NULLPTR 1
  133. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  134. # define BOOST_ASIO_HAS_CSTDINT 1
  135. # define BOOST_ASIO_HAS_STD_THREAD 1
  136. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  137. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  138. # define BOOST_ASIO_HAS_STD_FUTURE 1
  139. # define BOOST_ASIO_HAS_STD_TUPLE 1
  140. # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
  141. # define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
  142. # define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
  143. # define BOOST_ASIO_HAS_STD_HASH 1
  144. #endif // !defined(BOOST_ASIO_DISABLE_CXX11_MACROS)
  145. // Support for static constexpr with default initialisation.
  146. #if !defined(BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
  147. # if defined(__GNUC__)
  148. # if (__GNUC__ >= 8)
  149. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  150. static constexpr const type name{}
  151. # else // (__GNUC__ >= 8)
  152. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  153. static const type name
  154. # endif // (__GNUC__ >= 8)
  155. # elif defined(BOOST_ASIO_MSVC)
  156. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  157. static const type name
  158. # else // defined(BOOST_ASIO_MSVC)
  159. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  160. static constexpr const type name{}
  161. # endif // defined(BOOST_ASIO_MSVC)
  162. #endif // !defined(BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
  163. // Support noexcept on function types on compilers known to allow it.
  164. #if !defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
  165. # if !defined(BOOST_ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE)
  166. # if defined(__clang__)
  167. # if (__cplusplus >= 202002)
  168. # define BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE 1
  169. # endif // (__cplusplus >= 202002)
  170. # elif defined(__GNUC__)
  171. # if (__cplusplus >= 202002)
  172. # define BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE 1
  173. # endif // (__cplusplus >= 202002)
  174. # elif defined(BOOST_ASIO_MSVC)
  175. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 202002)
  176. # define BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE 1
  177. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 202002)
  178. # endif // defined(BOOST_ASIO_MSVC)
  179. # endif // !defined(BOOST_ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE)
  180. #endif // !defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
  181. // Support return type deduction on compilers known to allow it.
  182. #if !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
  183. # if !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
  184. # if defined(__clang__)
  185. # if __has_feature(__cxx_return_type_deduction__)
  186. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  187. # endif // __has_feature(__cxx_return_type_deduction__)
  188. # elif (__cplusplus >= 201402)
  189. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  190. # elif defined(__cpp_return_type_deduction)
  191. # if (__cpp_return_type_deduction >= 201304)
  192. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  193. # endif // (__cpp_return_type_deduction >= 201304)
  194. # elif defined(BOOST_ASIO_MSVC)
  195. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 201402)
  196. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  197. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201402)
  198. # endif // defined(BOOST_ASIO_MSVC)
  199. # endif // !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
  200. #endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
  201. // Support concepts on compilers known to allow them.
  202. #if !defined(BOOST_ASIO_HAS_CONCEPTS)
  203. # if !defined(BOOST_ASIO_DISABLE_CONCEPTS)
  204. # if defined(__cpp_concepts)
  205. # define BOOST_ASIO_HAS_CONCEPTS 1
  206. # if (__cpp_concepts >= 201707)
  207. # define BOOST_ASIO_CONCEPT concept
  208. # else // (__cpp_concepts >= 201707)
  209. # define BOOST_ASIO_CONCEPT concept bool
  210. # endif // (__cpp_concepts >= 201707)
  211. # endif // defined(__cpp_concepts)
  212. # endif // !defined(BOOST_ASIO_DISABLE_CONCEPTS)
  213. #endif // !defined(BOOST_ASIO_HAS_CONCEPTS)
  214. // Support concepts on compilers known to allow them.
  215. #if !defined(BOOST_ASIO_HAS_STD_CONCEPTS)
  216. # if !defined(BOOST_ASIO_DISABLE_STD_CONCEPTS)
  217. # if defined(BOOST_ASIO_HAS_CONCEPTS)
  218. # if (__cpp_lib_concepts >= 202002L)
  219. # define BOOST_ASIO_HAS_STD_CONCEPTS 1
  220. # endif // (__cpp_concepts >= 202002L)
  221. # endif // defined(BOOST_ASIO_HAS_CONCEPTS)
  222. # endif // !defined(BOOST_ASIO_DISABLE_STD_CONCEPTS)
  223. #endif // !defined(BOOST_ASIO_HAS_STD_CONCEPTS)
  224. // Support template variables on compilers known to allow it.
  225. #if !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  226. # if !defined(BOOST_ASIO_DISABLE_VARIABLE_TEMPLATES)
  227. # if defined(__clang__)
  228. # if (__cplusplus >= 201402)
  229. # if __has_feature(__cxx_variable_templates__)
  230. # define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
  231. # endif // __has_feature(__cxx_variable_templates__)
  232. # endif // (__cplusplus >= 201402)
  233. # elif defined(__GNUC__) && !defined(__INTEL_COMPILER)
  234. # if (__GNUC__ >= 6)
  235. # if (__cplusplus >= 201402)
  236. # define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
  237. # endif // (__cplusplus >= 201402)
  238. # endif // (__GNUC__ >= 6)
  239. # endif // defined(__GNUC__) && !defined(__INTEL_COMPILER)
  240. # if defined(BOOST_ASIO_MSVC)
  241. # if (_MSC_VER >= 1901)
  242. # define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
  243. # endif // (_MSC_VER >= 1901)
  244. # endif // defined(BOOST_ASIO_MSVC)
  245. # endif // !defined(BOOST_ASIO_DISABLE_VARIABLE_TEMPLATES)
  246. #endif // !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  247. // Support SFINAEd template variables on compilers known to allow it.
  248. #if !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  249. # if !defined(BOOST_ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES)
  250. # if defined(__clang__)
  251. # if (__cplusplus >= 201703)
  252. # if __has_feature(__cxx_variable_templates__)
  253. # define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
  254. # endif // __has_feature(__cxx_variable_templates__)
  255. # endif // (__cplusplus >= 201703)
  256. # elif defined(__GNUC__)
  257. # if ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8)
  258. # if (__cplusplus >= 201402)
  259. # define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
  260. # endif // (__cplusplus >= 201402)
  261. # endif // ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8)
  262. # endif // defined(__GNUC__)
  263. # if defined(BOOST_ASIO_MSVC)
  264. # if (_MSC_VER >= 1901)
  265. # define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
  266. # endif // (_MSC_VER >= 1901)
  267. # endif // defined(BOOST_ASIO_MSVC)
  268. # endif // !defined(BOOST_ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES)
  269. #endif // !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  270. // Support SFINAE use of constant expressions on compilers known to allow it.
  271. #if !defined(BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
  272. # if !defined(BOOST_ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE)
  273. # if defined(__clang__)
  274. # if (__cplusplus >= 201402)
  275. # define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
  276. # endif // (__cplusplus >= 201402)
  277. # elif defined(__GNUC__) && !defined(__INTEL_COMPILER)
  278. # if (__GNUC__ >= 7)
  279. # if (__cplusplus >= 201402)
  280. # define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
  281. # endif // (__cplusplus >= 201402)
  282. # endif // (__GNUC__ >= 7)
  283. # endif // defined(__GNUC__) && !defined(__INTEL_COMPILER)
  284. # if defined(BOOST_ASIO_MSVC)
  285. # if (_MSC_VER >= 1901)
  286. # define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
  287. # endif // (_MSC_VER >= 1901)
  288. # endif // defined(BOOST_ASIO_MSVC)
  289. # endif // !defined(BOOST_ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE)
  290. #endif // !defined(BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
  291. // Enable workarounds for lack of working expression SFINAE.
  292. #if !defined(BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE)
  293. # if !defined(BOOST_ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
  294. # if !defined(BOOST_ASIO_MSVC) && !defined(__INTEL_COMPILER)
  295. # if (__cplusplus >= 201103)
  296. # define BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE 1
  297. # endif // (__cplusplus >= 201103)
  298. # elif defined(BOOST_ASIO_MSVC) && (_MSC_VER >= 1929)
  299. # if (_MSVC_LANG >= 202000)
  300. # define BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE 1
  301. # endif // (_MSVC_LANG >= 202000)
  302. # endif // defined(BOOST_ASIO_MSVC) && (_MSC_VER >= 1929)
  303. # endif // !defined(BOOST_ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
  304. #endif // !defined(BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE)
  305. // Support for capturing parameter packs in lambdas.
  306. #if !defined(BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
  307. # if !defined(BOOST_ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
  308. # if defined(__GNUC__)
  309. # if (__GNUC__ >= 6)
  310. # define BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
  311. # endif // (__GNUC__ >= 6)
  312. # elif defined(BOOST_ASIO_MSVC)
  313. # if (_MSVC_LANG >= 201103)
  314. # define BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
  315. # endif // (_MSC_LANG >= 201103)
  316. # else // defined(BOOST_ASIO_MSVC)
  317. # if (__cplusplus >= 201103)
  318. # define BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
  319. # endif // (__cplusplus >= 201103)
  320. # endif // defined(BOOST_ASIO_MSVC)
  321. # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
  322. #endif // !defined(BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
  323. // Default alignment.
  324. #if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
  325. # define BOOST_ASIO_DEFAULT_ALIGN __STDCPP_DEFAULT_NEW_ALIGNMENT__
  326. #elif defined(__GNUC__)
  327. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  328. # define BOOST_ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
  329. # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  330. # define BOOST_ASIO_DEFAULT_ALIGN alignof(max_align_t)
  331. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  332. #else // defined(__GNUC__)
  333. # define BOOST_ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
  334. #endif // defined(__GNUC__)
  335. // Standard library support for aligned allocation.
  336. #if !defined(BOOST_ASIO_HAS_STD_ALIGNED_ALLOC)
  337. # if !defined(BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC)
  338. # if (__cplusplus >= 201703)
  339. # if defined(__clang__)
  340. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  341. # if (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) \
  342. && !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
  343. # if defined(__APPLE__)
  344. # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  345. # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
  346. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  347. # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
  348. # elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
  349. # if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
  350. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  351. # endif // (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
  352. # elif defined(__TV_OS_VERSION_MIN_REQUIRED)
  353. # if (__TV_OS_VERSION_MIN_REQUIRED >= 130000)
  354. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  355. # endif // (__TV_OS_VERSION_MIN_REQUIRED >= 130000)
  356. # elif defined(__WATCH_OS_VERSION_MIN_REQUIRED)
  357. # if (__WATCH_OS_VERSION_MIN_REQUIRED >= 60000)
  358. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  359. # endif // (__WATCH_OS_VERSION_MIN_REQUIRED >= 60000)
  360. # endif // defined(__WATCH_OS_X_VERSION_MIN_REQUIRED)
  361. # else // defined(__APPLE__)
  362. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  363. # endif // defined(__APPLE__)
  364. # endif // (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC)
  365. // && !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
  366. # elif defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  367. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  368. # endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  369. # elif defined(__GNUC__)
  370. # if ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 7)
  371. # if defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  372. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  373. # endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  374. # endif // ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 7)
  375. # endif // defined(__GNUC__)
  376. # endif // (__cplusplus >= 201703)
  377. # endif // !defined(BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC)
  378. #endif // !defined(BOOST_ASIO_HAS_STD_ALIGNED_ALLOC)
  379. // Boost support for chrono.
  380. #if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  381. # if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
  382. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
  383. # define BOOST_ASIO_HAS_BOOST_CHRONO 1
  384. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
  385. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
  386. #endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  387. // Some form of chrono library is available.
  388. #if !defined(BOOST_ASIO_HAS_CHRONO)
  389. # if defined(BOOST_ASIO_HAS_STD_CHRONO) \
  390. || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  391. # define BOOST_ASIO_HAS_CHRONO 1
  392. # endif // defined(BOOST_ASIO_HAS_STD_CHRONO)
  393. // || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  394. #endif // !defined(BOOST_ASIO_HAS_CHRONO)
  395. // Boost support for the DateTime library.
  396. #if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  397. # if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
  398. # define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
  399. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
  400. #endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  401. // Boost support for the Coroutine library.
  402. #if !defined(BOOST_ASIO_HAS_BOOST_COROUTINE)
  403. # if !defined(BOOST_ASIO_DISABLE_BOOST_COROUTINE)
  404. # define BOOST_ASIO_HAS_BOOST_COROUTINE 1
  405. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_COROUTINE)
  406. #endif // !defined(BOOST_ASIO_HAS_BOOST_COROUTINE)
  407. // Boost support for the Context library's fibers.
  408. #if !defined(BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER)
  409. # if !defined(BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER)
  410. # if defined(__clang__)
  411. # if (__cplusplus >= 201103)
  412. # define BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER 1
  413. # endif // (__cplusplus >= 201103)
  414. # elif defined(__GNUC__)
  415. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  416. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  417. # define BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER 1
  418. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  419. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  420. # endif // defined(__GNUC__)
  421. # if defined(BOOST_ASIO_MSVC)
  422. # if (_MSVC_LANG >= 201103)
  423. # define BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER 1
  424. # endif // (_MSC_LANG >= 201103)
  425. # endif // defined(BOOST_ASIO_MSVC)
  426. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER)
  427. #endif // !defined(BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER)
  428. // Standard library support for std::string_view.
  429. #if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  430. # if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
  431. # if defined(__clang__)
  432. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  433. # if (__cplusplus >= 201402)
  434. # if __has_include(<string_view>)
  435. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  436. # endif // __has_include(<string_view>)
  437. # endif // (__cplusplus >= 201402)
  438. # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  439. # if (__cplusplus >= 201703)
  440. # if __has_include(<string_view>)
  441. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  442. # endif // __has_include(<string_view>)
  443. # endif // (__cplusplus >= 201703)
  444. # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  445. # elif defined(__GNUC__)
  446. # if (__GNUC__ >= 7)
  447. # if (__cplusplus >= 201703)
  448. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  449. # endif // (__cplusplus >= 201703)
  450. # endif // (__GNUC__ >= 7)
  451. # elif defined(BOOST_ASIO_MSVC)
  452. # if (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
  453. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  454. # endif // (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
  455. # endif // defined(BOOST_ASIO_MSVC)
  456. # endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
  457. #endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  458. // Standard library support for std::experimental::string_view.
  459. #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  460. # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
  461. # if defined(__clang__)
  462. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  463. # if (_LIBCPP_VERSION < 7000)
  464. # if (__cplusplus >= 201402)
  465. # if __has_include(<experimental/string_view>)
  466. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  467. # endif // __has_include(<experimental/string_view>)
  468. # endif // (__cplusplus >= 201402)
  469. # endif // (_LIBCPP_VERSION < 7000)
  470. # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  471. # if (__cplusplus >= 201402)
  472. # if __has_include(<experimental/string_view>)
  473. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  474. # endif // __has_include(<experimental/string_view>)
  475. # endif // (__cplusplus >= 201402)
  476. # endif // // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  477. # elif defined(__GNUC__)
  478. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  479. # if (__cplusplus >= 201402)
  480. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  481. # endif // (__cplusplus >= 201402)
  482. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  483. # endif // defined(__GNUC__)
  484. # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
  485. #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  486. // Standard library has a string_view that we can use.
  487. #if !defined(BOOST_ASIO_HAS_STRING_VIEW)
  488. # if !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
  489. # if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  490. # define BOOST_ASIO_HAS_STRING_VIEW 1
  491. # elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  492. # define BOOST_ASIO_HAS_STRING_VIEW 1
  493. # endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  494. # endif // !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
  495. #endif // !defined(BOOST_ASIO_HAS_STRING_VIEW)
  496. // Standard library has invoke_result (which supersedes result_of).
  497. #if !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
  498. # if !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
  499. # if defined(BOOST_ASIO_MSVC)
  500. # if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
  501. # define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
  502. # endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
  503. # else // defined(BOOST_ASIO_MSVC)
  504. # if (__cplusplus >= 201703)
  505. # define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
  506. # endif // (__cplusplus >= 201703)
  507. # endif // defined(BOOST_ASIO_MSVC)
  508. # endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
  509. #endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
  510. // Standard library support for std::any.
  511. #if !defined(BOOST_ASIO_HAS_STD_ANY)
  512. # if !defined(BOOST_ASIO_DISABLE_STD_ANY)
  513. # if defined(__clang__)
  514. # if (__cplusplus >= 201703)
  515. # if __has_include(<any>)
  516. # define BOOST_ASIO_HAS_STD_ANY 1
  517. # endif // __has_include(<any>)
  518. # endif // (__cplusplus >= 201703)
  519. # elif defined(__GNUC__)
  520. # if (__GNUC__ >= 7)
  521. # if (__cplusplus >= 201703)
  522. # define BOOST_ASIO_HAS_STD_ANY 1
  523. # endif // (__cplusplus >= 201703)
  524. # endif // (__GNUC__ >= 7)
  525. # endif // defined(__GNUC__)
  526. # if defined(BOOST_ASIO_MSVC)
  527. # if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  528. # define BOOST_ASIO_HAS_STD_ANY 1
  529. # endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  530. # endif // defined(BOOST_ASIO_MSVC)
  531. # endif // !defined(BOOST_ASIO_DISABLE_STD_ANY)
  532. #endif // !defined(BOOST_ASIO_HAS_STD_ANY)
  533. // Standard library support for std::variant.
  534. #if !defined(BOOST_ASIO_HAS_STD_VARIANT)
  535. # if !defined(BOOST_ASIO_DISABLE_STD_VARIANT)
  536. # if defined(__clang__)
  537. # if (__cplusplus >= 201703)
  538. # if __has_include(<variant>)
  539. # define BOOST_ASIO_HAS_STD_VARIANT 1
  540. # endif // __has_include(<variant>)
  541. # endif // (__cplusplus >= 201703)
  542. # elif defined(__GNUC__)
  543. # if (__GNUC__ >= 7)
  544. # if (__cplusplus >= 201703)
  545. # define BOOST_ASIO_HAS_STD_VARIANT 1
  546. # endif // (__cplusplus >= 201703)
  547. # endif // (__GNUC__ >= 7)
  548. # endif // defined(__GNUC__)
  549. # if defined(BOOST_ASIO_MSVC)
  550. # if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  551. # define BOOST_ASIO_HAS_STD_VARIANT 1
  552. # endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  553. # endif // defined(BOOST_ASIO_MSVC)
  554. # endif // !defined(BOOST_ASIO_DISABLE_STD_VARIANT)
  555. #endif // !defined(BOOST_ASIO_HAS_STD_VARIANT)
  556. // Standard library support for std::source_location.
  557. #if !defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
  558. # if !defined(BOOST_ASIO_DISABLE_STD_SOURCE_LOCATION)
  559. // ...
  560. # endif // !defined(BOOST_ASIO_DISABLE_STD_SOURCE_LOCATION)
  561. #endif // !defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
  562. // Standard library support for std::experimental::source_location.
  563. #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  564. # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION)
  565. # if defined(__GNUC__)
  566. # if (__cplusplus >= 201709)
  567. # if __has_include(<experimental/source_location>)
  568. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION 1
  569. # endif // __has_include(<experimental/source_location>)
  570. # endif // (__cplusplus >= 201709)
  571. # endif // defined(__GNUC__)
  572. # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION)
  573. #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  574. // Standard library has a source_location that we can use.
  575. #if !defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
  576. # if !defined(BOOST_ASIO_DISABLE_SOURCE_LOCATION)
  577. # if defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
  578. # define BOOST_ASIO_HAS_SOURCE_LOCATION 1
  579. # elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  580. # define BOOST_ASIO_HAS_SOURCE_LOCATION 1
  581. # endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  582. # endif // !defined(BOOST_ASIO_DISABLE_SOURCE_LOCATION)
  583. #endif // !defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
  584. // Boost support for source_location and system errors.
  585. #if !defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  586. # if !defined(BOOST_ASIO_DISABLE_BOOST_SOURCE_LOCATION)
  587. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 107900)
  588. # define BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION 1
  589. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 107900)
  590. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_SOURCE_LOCATION)
  591. #endif // !defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  592. // Helper macros for working with Boost source locations.
  593. #if defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  594. # define BOOST_ASIO_SOURCE_LOCATION_PARAM \
  595. , const boost::source_location& loc
  596. # define BOOST_ASIO_SOURCE_LOCATION_DEFAULTED_PARAM \
  597. , const boost::source_location& loc = BOOST_CURRENT_LOCATION
  598. # define BOOST_ASIO_SOURCE_LOCATION_ARG , loc
  599. #else // if defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  600. # define BOOST_ASIO_SOURCE_LOCATION_PARAM
  601. # define BOOST_ASIO_SOURCE_LOCATION_DEFAULTED_PARAM
  602. # define BOOST_ASIO_SOURCE_LOCATION_ARG
  603. #endif // if defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  604. // Standard library support for std::index_sequence.
  605. #if !defined(BOOST_ASIO_HAS_STD_INDEX_SEQUENCE)
  606. # if !defined(BOOST_ASIO_DISABLE_STD_INDEX_SEQUENCE)
  607. # if defined(__clang__)
  608. # if (__cplusplus >= 201402)
  609. # define BOOST_ASIO_HAS_STD_INDEX_SEQUENCE 1
  610. # endif // (__cplusplus >= 201402)
  611. # elif defined(__GNUC__)
  612. # if (__GNUC__ >= 7)
  613. # if (__cplusplus >= 201402)
  614. # define BOOST_ASIO_HAS_STD_INDEX_SEQUENCE 1
  615. # endif // (__cplusplus >= 201402)
  616. # endif // (__GNUC__ >= 7)
  617. # endif // defined(__GNUC__)
  618. # if defined(BOOST_ASIO_MSVC)
  619. # if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201402)
  620. # define BOOST_ASIO_HAS_STD_INDEX_SEQUENCE 1
  621. # endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201402)
  622. # endif // defined(BOOST_ASIO_MSVC)
  623. # endif // !defined(BOOST_ASIO_DISABLE_STD_INDEX_SEQUENCE)
  624. #endif // !defined(BOOST_ASIO_HAS_STD_INDEX_SEQUENCE)
  625. // Windows App target. Windows but with a limited API.
  626. #if !defined(BOOST_ASIO_WINDOWS_APP)
  627. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
  628. # include <winapifamily.h>
  629. # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
  630. || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)) \
  631. && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  632. # define BOOST_ASIO_WINDOWS_APP 1
  633. # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  634. // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  635. # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
  636. #endif // !defined(BOOST_ASIO_WINDOWS_APP)
  637. // Legacy WinRT target. Windows App is preferred.
  638. #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  639. # if !defined(BOOST_ASIO_WINDOWS_APP)
  640. # if defined(__cplusplus_winrt)
  641. # include <winapifamily.h>
  642. # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
  643. && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  644. # define BOOST_ASIO_WINDOWS_RUNTIME 1
  645. # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  646. // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  647. # endif // defined(__cplusplus_winrt)
  648. # endif // !defined(BOOST_ASIO_WINDOWS_APP)
  649. #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  650. // Windows target. Excludes WinRT but includes Windows App targets.
  651. #if !defined(BOOST_ASIO_WINDOWS)
  652. # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  653. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
  654. # define BOOST_ASIO_WINDOWS 1
  655. # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  656. # define BOOST_ASIO_WINDOWS 1
  657. # elif defined(BOOST_ASIO_WINDOWS_APP)
  658. # define BOOST_ASIO_WINDOWS 1
  659. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
  660. # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  661. #endif // !defined(BOOST_ASIO_WINDOWS)
  662. // Windows: target OS version.
  663. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  664. # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
  665. # if defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
  666. # pragma message( \
  667. "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
  668. "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\
  669. "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\
  670. "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).")
  671. # else // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
  672. # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
  673. # warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line.
  674. # warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
  675. # endif // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
  676. # define _WIN32_WINNT 0x0601
  677. # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
  678. # if defined(_MSC_VER)
  679. # if defined(_WIN32) && !defined(WIN32)
  680. # if !defined(_WINSOCK2API_)
  681. # define WIN32 // Needed for correct types in winsock2.h
  682. # else // !defined(_WINSOCK2API_)
  683. # error Please define the macro WIN32 in your compiler options
  684. # endif // !defined(_WINSOCK2API_)
  685. # endif // defined(_WIN32) && !defined(WIN32)
  686. # endif // defined(_MSC_VER)
  687. # if defined(__BORLANDC__)
  688. # if defined(__WIN32__) && !defined(WIN32)
  689. # if !defined(_WINSOCK2API_)
  690. # define WIN32 // Needed for correct types in winsock2.h
  691. # else // !defined(_WINSOCK2API_)
  692. # error Please define the macro WIN32 in your compiler options
  693. # endif // !defined(_WINSOCK2API_)
  694. # endif // defined(__WIN32__) && !defined(WIN32)
  695. # endif // defined(__BORLANDC__)
  696. # if defined(__CYGWIN__)
  697. # if !defined(__USE_W32_SOCKETS)
  698. # error You must add -D__USE_W32_SOCKETS to your compiler options.
  699. # endif // !defined(__USE_W32_SOCKETS)
  700. # endif // defined(__CYGWIN__)
  701. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  702. // Windows: minimise header inclusion.
  703. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  704. # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
  705. # if !defined(WIN32_LEAN_AND_MEAN)
  706. # define WIN32_LEAN_AND_MEAN
  707. # endif // !defined(WIN32_LEAN_AND_MEAN)
  708. # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
  709. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  710. // Windows: suppress definition of "min" and "max" macros.
  711. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  712. # if !defined(BOOST_ASIO_NO_NOMINMAX)
  713. # if !defined(NOMINMAX)
  714. # define NOMINMAX 1
  715. # endif // !defined(NOMINMAX)
  716. # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
  717. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  718. // Windows: IO Completion Ports.
  719. #if !defined(BOOST_ASIO_HAS_IOCP)
  720. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  721. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
  722. # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  723. # if !defined(BOOST_ASIO_DISABLE_IOCP)
  724. # define BOOST_ASIO_HAS_IOCP 1
  725. # endif // !defined(BOOST_ASIO_DISABLE_IOCP)
  726. # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  727. # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
  728. # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  729. #endif // !defined(BOOST_ASIO_HAS_IOCP)
  730. // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
  731. // get access to the various platform feature macros, e.g. to be able to test
  732. // for threads support.
  733. #if !defined(BOOST_ASIO_HAS_UNISTD_H)
  734. # if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  735. # if defined(unix) \
  736. || defined(__unix) \
  737. || defined(_XOPEN_SOURCE) \
  738. || defined(_POSIX_SOURCE) \
  739. || (defined(__MACH__) && defined(__APPLE__)) \
  740. || defined(__FreeBSD__) \
  741. || defined(__NetBSD__) \
  742. || defined(__OpenBSD__) \
  743. || defined(__linux__) \
  744. || defined(__HAIKU__)
  745. # define BOOST_ASIO_HAS_UNISTD_H 1
  746. # endif
  747. # endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  748. #endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
  749. #if defined(BOOST_ASIO_HAS_UNISTD_H)
  750. # include <unistd.h>
  751. #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
  752. // Linux: epoll, eventfd, timerfd and io_uring.
  753. #if defined(__linux__)
  754. # include <linux/version.h>
  755. # if !defined(BOOST_ASIO_HAS_EPOLL)
  756. # if !defined(BOOST_ASIO_DISABLE_EPOLL)
  757. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
  758. # define BOOST_ASIO_HAS_EPOLL 1
  759. # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
  760. # endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
  761. # endif // !defined(BOOST_ASIO_HAS_EPOLL)
  762. # if !defined(BOOST_ASIO_HAS_EVENTFD)
  763. # if !defined(BOOST_ASIO_DISABLE_EVENTFD)
  764. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  765. # define BOOST_ASIO_HAS_EVENTFD 1
  766. # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  767. # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
  768. # endif // !defined(BOOST_ASIO_HAS_EVENTFD)
  769. # if !defined(BOOST_ASIO_HAS_TIMERFD)
  770. # if defined(BOOST_ASIO_HAS_EPOLL)
  771. # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
  772. # define BOOST_ASIO_HAS_TIMERFD 1
  773. # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
  774. # endif // defined(BOOST_ASIO_HAS_EPOLL)
  775. # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
  776. # if defined(BOOST_ASIO_HAS_IO_URING)
  777. # if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
  778. # error Linux kernel 5.10 or later is required to support io_uring
  779. # endif // LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
  780. # endif // defined(BOOST_ASIO_HAS_IO_URING)
  781. #endif // defined(__linux__)
  782. // Linux: io_uring is used instead of epoll.
  783. #if !defined(BOOST_ASIO_HAS_IO_URING_AS_DEFAULT)
  784. # if !defined(BOOST_ASIO_HAS_EPOLL) && defined(BOOST_ASIO_HAS_IO_URING)
  785. # define BOOST_ASIO_HAS_IO_URING_AS_DEFAULT 1
  786. # endif // !defined(BOOST_ASIO_HAS_EPOLL) && defined(BOOST_ASIO_HAS_IO_URING)
  787. #endif // !defined(BOOST_ASIO_HAS_IO_URING_AS_DEFAULT)
  788. // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
  789. #if (defined(__MACH__) && defined(__APPLE__)) \
  790. || defined(__FreeBSD__) \
  791. || defined(__NetBSD__) \
  792. || defined(__OpenBSD__)
  793. # if !defined(BOOST_ASIO_HAS_KQUEUE)
  794. # if !defined(BOOST_ASIO_DISABLE_KQUEUE)
  795. # define BOOST_ASIO_HAS_KQUEUE 1
  796. # endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
  797. # endif // !defined(BOOST_ASIO_HAS_KQUEUE)
  798. #endif // (defined(__MACH__) && defined(__APPLE__))
  799. // || defined(__FreeBSD__)
  800. // || defined(__NetBSD__)
  801. // || defined(__OpenBSD__)
  802. // Solaris: /dev/poll.
  803. #if defined(__sun)
  804. # if !defined(BOOST_ASIO_HAS_DEV_POLL)
  805. # if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
  806. # define BOOST_ASIO_HAS_DEV_POLL 1
  807. # endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
  808. # endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
  809. #endif // defined(__sun)
  810. // Serial ports.
  811. #if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
  812. # if defined(BOOST_ASIO_HAS_IOCP) \
  813. || !defined(BOOST_ASIO_WINDOWS) \
  814. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  815. && !defined(__CYGWIN__)
  816. # if !defined(__SYMBIAN32__)
  817. # if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
  818. # define BOOST_ASIO_HAS_SERIAL_PORT 1
  819. # endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
  820. # endif // !defined(__SYMBIAN32__)
  821. # endif // defined(BOOST_ASIO_HAS_IOCP)
  822. // || !defined(BOOST_ASIO_WINDOWS)
  823. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  824. // && !defined(__CYGWIN__)
  825. #endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
  826. // Windows: stream handles.
  827. #if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
  828. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
  829. # if defined(BOOST_ASIO_HAS_IOCP)
  830. # define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
  831. # endif // defined(BOOST_ASIO_HAS_IOCP)
  832. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
  833. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
  834. // Windows: random access handles.
  835. #if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  836. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
  837. # if defined(BOOST_ASIO_HAS_IOCP)
  838. # define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
  839. # endif // defined(BOOST_ASIO_HAS_IOCP)
  840. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
  841. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  842. // Windows: object handles.
  843. #if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
  844. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
  845. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  846. # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  847. # define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
  848. # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  849. # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  850. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
  851. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
  852. // Windows: OVERLAPPED wrapper.
  853. #if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
  854. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
  855. # if defined(BOOST_ASIO_HAS_IOCP)
  856. # define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
  857. # endif // defined(BOOST_ASIO_HAS_IOCP)
  858. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
  859. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
  860. // POSIX: stream-oriented file descriptors.
  861. #if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
  862. # if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
  863. # if !defined(BOOST_ASIO_WINDOWS) \
  864. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  865. && !defined(__CYGWIN__)
  866. # define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
  867. # endif // !defined(BOOST_ASIO_WINDOWS)
  868. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  869. // && !defined(__CYGWIN__)
  870. # endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
  871. #endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
  872. // UNIX domain sockets.
  873. #if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
  874. # if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
  875. # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  876. # define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
  877. # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  878. # endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
  879. #endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
  880. // Files.
  881. #if !defined(BOOST_ASIO_HAS_FILE)
  882. # if !defined(BOOST_ASIO_DISABLE_FILE)
  883. # if defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  884. # define BOOST_ASIO_HAS_FILE 1
  885. # elif defined(BOOST_ASIO_HAS_IO_URING)
  886. # define BOOST_ASIO_HAS_FILE 1
  887. # endif // defined(BOOST_ASIO_HAS_IO_URING)
  888. # endif // !defined(BOOST_ASIO_DISABLE_FILE)
  889. #endif // !defined(BOOST_ASIO_HAS_FILE)
  890. // Pipes.
  891. #if !defined(BOOST_ASIO_HAS_PIPE)
  892. # if defined(BOOST_ASIO_HAS_IOCP) \
  893. || !defined(BOOST_ASIO_WINDOWS) \
  894. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  895. && !defined(__CYGWIN__)
  896. # if !defined(__SYMBIAN32__)
  897. # if !defined(BOOST_ASIO_DISABLE_PIPE)
  898. # define BOOST_ASIO_HAS_PIPE 1
  899. # endif // !defined(BOOST_ASIO_DISABLE_PIPE)
  900. # endif // !defined(__SYMBIAN32__)
  901. # endif // defined(BOOST_ASIO_HAS_IOCP)
  902. // || !defined(BOOST_ASIO_WINDOWS)
  903. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  904. // && !defined(__CYGWIN__)
  905. #endif // !defined(BOOST_ASIO_HAS_PIPE)
  906. // Can use sigaction() instead of signal().
  907. #if !defined(BOOST_ASIO_HAS_SIGACTION)
  908. # if !defined(BOOST_ASIO_DISABLE_SIGACTION)
  909. # if !defined(BOOST_ASIO_WINDOWS) \
  910. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  911. && !defined(__CYGWIN__)
  912. # define BOOST_ASIO_HAS_SIGACTION 1
  913. # endif // !defined(BOOST_ASIO_WINDOWS)
  914. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  915. // && !defined(__CYGWIN__)
  916. # endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
  917. #endif // !defined(BOOST_ASIO_HAS_SIGACTION)
  918. // Can use signal().
  919. #if !defined(BOOST_ASIO_HAS_SIGNAL)
  920. # if !defined(BOOST_ASIO_DISABLE_SIGNAL)
  921. # if !defined(UNDER_CE)
  922. # define BOOST_ASIO_HAS_SIGNAL 1
  923. # endif // !defined(UNDER_CE)
  924. # endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
  925. #endif // !defined(BOOST_ASIO_HAS_SIGNAL)
  926. // Can use getaddrinfo() and getnameinfo().
  927. #if !defined(BOOST_ASIO_HAS_GETADDRINFO)
  928. # if !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
  929. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  930. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
  931. # define BOOST_ASIO_HAS_GETADDRINFO 1
  932. # elif defined(UNDER_CE)
  933. # define BOOST_ASIO_HAS_GETADDRINFO 1
  934. # endif // defined(UNDER_CE)
  935. # elif defined(__MACH__) && defined(__APPLE__)
  936. # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  937. # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
  938. # define BOOST_ASIO_HAS_GETADDRINFO 1
  939. # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
  940. # else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  941. # define BOOST_ASIO_HAS_GETADDRINFO 1
  942. # endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  943. # else // defined(__MACH__) && defined(__APPLE__)
  944. # define BOOST_ASIO_HAS_GETADDRINFO 1
  945. # endif // defined(__MACH__) && defined(__APPLE__)
  946. # endif // !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
  947. #endif // !defined(BOOST_ASIO_HAS_GETADDRINFO)
  948. // Whether standard iostreams are disabled.
  949. #if !defined(BOOST_ASIO_NO_IOSTREAM)
  950. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
  951. # define BOOST_ASIO_NO_IOSTREAM 1
  952. # endif // !defined(BOOST_NO_IOSTREAM)
  953. #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
  954. // Whether exception handling is disabled.
  955. #if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  956. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
  957. # define BOOST_ASIO_NO_EXCEPTIONS 1
  958. # endif // !defined(BOOST_NO_EXCEPTIONS)
  959. #endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  960. // Whether the typeid operator is supported.
  961. #if !defined(BOOST_ASIO_NO_TYPEID)
  962. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
  963. # define BOOST_ASIO_NO_TYPEID 1
  964. # endif // !defined(BOOST_NO_TYPEID)
  965. #endif // !defined(BOOST_ASIO_NO_TYPEID)
  966. // Threads.
  967. #if !defined(BOOST_ASIO_HAS_THREADS)
  968. # if !defined(BOOST_ASIO_DISABLE_THREADS)
  969. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
  970. # define BOOST_ASIO_HAS_THREADS 1
  971. # elif defined(__GNUC__) && !defined(__MINGW32__) \
  972. && !defined(linux) && !defined(__linux) && !defined(__linux__)
  973. # define BOOST_ASIO_HAS_THREADS 1
  974. # elif defined(_MT) || defined(__MT__)
  975. # define BOOST_ASIO_HAS_THREADS 1
  976. # elif defined(_REENTRANT)
  977. # define BOOST_ASIO_HAS_THREADS 1
  978. # elif defined(__APPLE__)
  979. # define BOOST_ASIO_HAS_THREADS 1
  980. # elif defined(__HAIKU__)
  981. # define BOOST_ASIO_HAS_THREADS 1
  982. # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
  983. # define BOOST_ASIO_HAS_THREADS 1
  984. # elif defined(_PTHREADS)
  985. # define BOOST_ASIO_HAS_THREADS 1
  986. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
  987. # endif // !defined(BOOST_ASIO_DISABLE_THREADS)
  988. #endif // !defined(BOOST_ASIO_HAS_THREADS)
  989. // POSIX threads.
  990. #if !defined(BOOST_ASIO_HAS_PTHREADS)
  991. # if defined(BOOST_ASIO_HAS_THREADS)
  992. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
  993. # define BOOST_ASIO_HAS_PTHREADS 1
  994. # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
  995. # define BOOST_ASIO_HAS_PTHREADS 1
  996. # elif defined(__HAIKU__)
  997. # define BOOST_ASIO_HAS_PTHREADS 1
  998. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
  999. # endif // defined(BOOST_ASIO_HAS_THREADS)
  1000. #endif // !defined(BOOST_ASIO_HAS_PTHREADS)
  1001. // Helper to prevent macro expansion.
  1002. #define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
  1003. // Helper to define in-class constants.
  1004. #if !defined(BOOST_ASIO_STATIC_CONSTANT)
  1005. # if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1006. # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
  1007. BOOST_STATIC_CONSTANT(type, assignment)
  1008. # else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1009. # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
  1010. static const type assignment
  1011. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1012. #endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
  1013. // Boost align library.
  1014. #if !defined(BOOST_ASIO_HAS_BOOST_ALIGN)
  1015. # if !defined(BOOST_ASIO_DISABLE_BOOST_ALIGN)
  1016. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105600)
  1017. # define BOOST_ASIO_HAS_BOOST_ALIGN 1
  1018. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105600)
  1019. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ALIGN)
  1020. #endif // !defined(BOOST_ASIO_HAS_BOOST_ALIGN)
  1021. // Boost array library.
  1022. #if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
  1023. # if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
  1024. # define BOOST_ASIO_HAS_BOOST_ARRAY 1
  1025. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
  1026. #endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
  1027. // Boost assert macro.
  1028. #if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
  1029. # if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
  1030. # define BOOST_ASIO_HAS_BOOST_ASSERT 1
  1031. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
  1032. #endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
  1033. // Boost limits header.
  1034. #if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
  1035. # if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
  1036. # define BOOST_ASIO_HAS_BOOST_LIMITS 1
  1037. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
  1038. #endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
  1039. // Boost throw_exception function.
  1040. #if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
  1041. # if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
  1042. # define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
  1043. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
  1044. #endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
  1045. // Boost regex library.
  1046. #if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
  1047. # if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
  1048. # define BOOST_ASIO_HAS_BOOST_REGEX 1
  1049. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
  1050. #endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
  1051. // Boost bind function.
  1052. #if !defined(BOOST_ASIO_HAS_BOOST_BIND)
  1053. # if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
  1054. # define BOOST_ASIO_HAS_BOOST_BIND 1
  1055. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
  1056. #endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
  1057. // Boost's BOOST_WORKAROUND macro.
  1058. #if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
  1059. # if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
  1060. # define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
  1061. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
  1062. #endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
  1063. // Microsoft Visual C++'s secure C runtime library.
  1064. #if !defined(BOOST_ASIO_HAS_SECURE_RTL)
  1065. # if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
  1066. # if defined(BOOST_ASIO_MSVC) \
  1067. && (BOOST_ASIO_MSVC >= 1400) \
  1068. && !defined(UNDER_CE)
  1069. # define BOOST_ASIO_HAS_SECURE_RTL 1
  1070. # endif // defined(BOOST_ASIO_MSVC)
  1071. // && (BOOST_ASIO_MSVC >= 1400)
  1072. // && !defined(UNDER_CE)
  1073. # endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
  1074. #endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
  1075. // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
  1076. #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
  1077. # if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
  1078. # if defined(__GNUC__)
  1079. # if (__GNUC__ >= 3)
  1080. # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
  1081. # endif // (__GNUC__ >= 3)
  1082. # elif !defined(__BORLANDC__) || defined(__clang__)
  1083. # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
  1084. # endif // !defined(__BORLANDC__) || defined(__clang__)
  1085. # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
  1086. #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
  1087. // Support for the __thread keyword extension, or equivalent.
  1088. #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
  1089. # if defined(__linux__)
  1090. # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  1091. # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
  1092. # if !defined(__INTEL_COMPILER) && !defined(__ICL) \
  1093. && !(defined(__clang__) && defined(__ANDROID__))
  1094. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1095. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1096. # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
  1097. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1098. # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
  1099. // && !(defined(__clang__) && defined(__ANDROID__))
  1100. # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
  1101. # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  1102. # endif // defined(__linux__)
  1103. # if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1104. # if (_MSC_VER >= 1700)
  1105. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1106. # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
  1107. # endif // (_MSC_VER >= 1700)
  1108. # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1109. # if defined(__APPLE__)
  1110. # if defined(__clang__)
  1111. # if defined(__apple_build_version__)
  1112. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1113. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1114. # endif // defined(__apple_build_version__)
  1115. # endif // defined(__clang__)
  1116. # endif // defined(__APPLE__)
  1117. # if !defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
  1118. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  1119. # if !defined(BOOST_NO_CXX11_THREAD_LOCAL)
  1120. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1121. # define BOOST_ASIO_THREAD_KEYWORD thread_local
  1122. # endif // !defined(BOOST_NO_CXX11_THREAD_LOCAL)
  1123. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  1124. # endif // !defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
  1125. #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
  1126. #if !defined(BOOST_ASIO_THREAD_KEYWORD)
  1127. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1128. #endif // !defined(BOOST_ASIO_THREAD_KEYWORD)
  1129. // Support for POSIX ssize_t typedef.
  1130. #if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
  1131. # if defined(__linux__) \
  1132. || (defined(__MACH__) && defined(__APPLE__))
  1133. # define BOOST_ASIO_HAS_SSIZE_T 1
  1134. # endif // defined(__linux__)
  1135. // || (defined(__MACH__) && defined(__APPLE__))
  1136. #endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
  1137. // Helper macros to manage transition away from error_code return values.
  1138. #if defined(BOOST_ASIO_NO_DEPRECATED)
  1139. # define BOOST_ASIO_SYNC_OP_VOID void
  1140. # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return
  1141. #else // defined(BOOST_ASIO_NO_DEPRECATED)
  1142. # define BOOST_ASIO_SYNC_OP_VOID boost::system::error_code
  1143. # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return e
  1144. #endif // defined(BOOST_ASIO_NO_DEPRECATED)
  1145. // Newer gcc, clang need special treatment to suppress unused typedef warnings.
  1146. #if defined(__clang__)
  1147. # if defined(__apple_build_version__)
  1148. # if (__clang_major__ >= 7)
  1149. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1150. # endif // (__clang_major__ >= 7)
  1151. # elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \
  1152. || (__clang_major__ > 3)
  1153. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1154. # endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6))
  1155. // || (__clang_major__ > 3)
  1156. #elif defined(__GNUC__)
  1157. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1158. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1159. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1160. #endif // defined(__GNUC__)
  1161. #if !defined(BOOST_ASIO_UNUSED_TYPEDEF)
  1162. # define BOOST_ASIO_UNUSED_TYPEDEF
  1163. #endif // !defined(BOOST_ASIO_UNUSED_TYPEDEF)
  1164. // Some versions of gcc generate spurious warnings about unused variables.
  1165. #if defined(__GNUC__)
  1166. # if (__GNUC__ >= 4)
  1167. # define BOOST_ASIO_UNUSED_VARIABLE __attribute__((__unused__))
  1168. # endif // (__GNUC__ >= 4)
  1169. #endif // defined(__GNUC__)
  1170. #if !defined(BOOST_ASIO_UNUSED_VARIABLE)
  1171. # define BOOST_ASIO_UNUSED_VARIABLE
  1172. #endif // !defined(BOOST_ASIO_UNUSED_VARIABLE)
  1173. // Helper macro to tell the optimiser what may be assumed to be true.
  1174. #if defined(BOOST_ASIO_MSVC)
  1175. # define BOOST_ASIO_ASSUME(expr) __assume(expr)
  1176. #elif defined(__clang__)
  1177. # if __has_builtin(__builtin_assume)
  1178. # define BOOST_ASIO_ASSUME(expr) __builtin_assume(expr)
  1179. # endif // __has_builtin(__builtin_assume)
  1180. #elif defined(__GNUC__)
  1181. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  1182. # define BOOST_ASIO_ASSUME(expr) if (expr) {} else { __builtin_unreachable(); }
  1183. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  1184. #endif // defined(__GNUC__)
  1185. #if !defined(BOOST_ASIO_ASSUME)
  1186. # define BOOST_ASIO_ASSUME(expr) (void)0
  1187. #endif // !defined(BOOST_ASIO_ASSUME)
  1188. // Support the co_await keyword on compilers known to allow it.
  1189. #if !defined(BOOST_ASIO_HAS_CO_AWAIT)
  1190. # if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
  1191. # if defined(BOOST_ASIO_MSVC)
  1192. # if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) && !defined(__clang__)
  1193. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1194. # elif (_MSC_FULL_VER >= 190023506)
  1195. # if defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
  1196. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1197. # endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
  1198. # endif // (_MSC_FULL_VER >= 190023506)
  1199. # elif defined(__clang__)
  1200. # if (__clang_major__ >= 14)
  1201. # if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
  1202. # if __has_include(<coroutine>)
  1203. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1204. # endif // __has_include(<coroutine>)
  1205. # elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  1206. # if __has_include(<experimental/coroutine>)
  1207. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1208. # endif // __has_include(<experimental/coroutine>)
  1209. # endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  1210. # else // (__clang_major__ >= 14)
  1211. # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  1212. # if __has_include(<experimental/coroutine>)
  1213. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1214. # endif // __has_include(<experimental/coroutine>)
  1215. # endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  1216. # endif // (__clang_major__ >= 14)
  1217. # elif defined(__GNUC__)
  1218. # if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  1219. # if __has_include(<coroutine>)
  1220. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1221. # endif // __has_include(<coroutine>)
  1222. # endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  1223. # endif // defined(__GNUC__)
  1224. # endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
  1225. #endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
  1226. // Standard library support for coroutines.
  1227. #if !defined(BOOST_ASIO_HAS_STD_COROUTINE)
  1228. # if !defined(BOOST_ASIO_DISABLE_STD_COROUTINE)
  1229. # if defined(BOOST_ASIO_MSVC)
  1230. # if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
  1231. # define BOOST_ASIO_HAS_STD_COROUTINE 1
  1232. # endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
  1233. # elif defined(__clang__)
  1234. # if (__clang_major__ >= 14)
  1235. # if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
  1236. # if __has_include(<coroutine>)
  1237. # define BOOST_ASIO_HAS_STD_COROUTINE 1
  1238. # endif // __has_include(<coroutine>)
  1239. # endif // (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
  1240. # endif // (__clang_major__ >= 14)
  1241. # elif defined(__GNUC__)
  1242. # if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  1243. # if __has_include(<coroutine>)
  1244. # define BOOST_ASIO_HAS_STD_COROUTINE 1
  1245. # endif // __has_include(<coroutine>)
  1246. # endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  1247. # endif // defined(__GNUC__)
  1248. # endif // !defined(BOOST_ASIO_DISABLE_STD_COROUTINE)
  1249. #endif // !defined(BOOST_ASIO_HAS_STD_COROUTINE)
  1250. // Compiler support for the the [[nodiscard]] attribute.
  1251. #if !defined(BOOST_ASIO_NODISCARD)
  1252. # if defined(__has_cpp_attribute)
  1253. # if __has_cpp_attribute(nodiscard)
  1254. # if (__cplusplus >= 201703)
  1255. # define BOOST_ASIO_NODISCARD [[nodiscard]]
  1256. # endif // (__cplusplus >= 201703)
  1257. # endif // __has_cpp_attribute(nodiscard)
  1258. # endif // defined(__has_cpp_attribute)
  1259. #endif // !defined(BOOST_ASIO_NODISCARD)
  1260. #if !defined(BOOST_ASIO_NODISCARD)
  1261. # define BOOST_ASIO_NODISCARD
  1262. #endif // !defined(BOOST_ASIO_NODISCARD)
  1263. // Kernel support for MSG_NOSIGNAL.
  1264. #if !defined(BOOST_ASIO_HAS_MSG_NOSIGNAL)
  1265. # if defined(__linux__)
  1266. # define BOOST_ASIO_HAS_MSG_NOSIGNAL 1
  1267. # elif defined(_POSIX_VERSION)
  1268. # if (_POSIX_VERSION >= 200809L)
  1269. # define BOOST_ASIO_HAS_MSG_NOSIGNAL 1
  1270. # endif // _POSIX_VERSION >= 200809L
  1271. # endif // defined(_POSIX_VERSION)
  1272. #endif // !defined(BOOST_ASIO_HAS_MSG_NOSIGNAL)
  1273. // Standard library support for std::to_address.
  1274. #if !defined(BOOST_ASIO_HAS_STD_TO_ADDRESS)
  1275. # if !defined(BOOST_ASIO_DISABLE_STD_TO_ADDRESS)
  1276. # if defined(__clang__)
  1277. # if (__cplusplus >= 202002)
  1278. # define BOOST_ASIO_HAS_STD_TO_ADDRESS 1
  1279. # endif // (__cplusplus >= 202002)
  1280. # elif defined(__GNUC__)
  1281. # if (__GNUC__ >= 8)
  1282. # if (__cplusplus >= 202002)
  1283. # define BOOST_ASIO_HAS_STD_TO_ADDRESS 1
  1284. # endif // (__cplusplus >= 202002)
  1285. # endif // (__GNUC__ >= 8)
  1286. # endif // defined(__GNUC__)
  1287. # if defined(BOOST_ASIO_MSVC)
  1288. # if (_MSC_VER >= 1922) && (_MSVC_LANG >= 202002)
  1289. # define BOOST_ASIO_HAS_STD_TO_ADDRESS 1
  1290. # endif // (_MSC_VER >= 1922) && (_MSVC_LANG >= 202002)
  1291. # endif // defined(BOOST_ASIO_MSVC)
  1292. # endif // !defined(BOOST_ASIO_DISABLE_STD_TO_ADDRESS)
  1293. #endif // !defined(BOOST_ASIO_HAS_STD_TO_ADDRESS)
  1294. // Standard library support for snprintf.
  1295. #if !defined(BOOST_ASIO_HAS_SNPRINTF)
  1296. # if !defined(BOOST_ASIO_DISABLE_SNPRINTF)
  1297. # if defined(__apple_build_version__)
  1298. # if (__clang_major__ >= 14)
  1299. # define BOOST_ASIO_HAS_SNPRINTF 1
  1300. # endif // (__clang_major__ >= 14)
  1301. # endif // defined(__apple_build_version__)
  1302. # endif // !defined(BOOST_ASIO_DISABLE_SNPRINTF)
  1303. #endif // !defined(BOOST_ASIO_HAS_SNPRINTF)
  1304. #endif // BOOST_ASIO_DETAIL_CONFIG_HPP