config.hpp 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282
  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. // Support move construction and assignment on compilers known to allow it.
  87. #if !defined(BOOST_ASIO_HAS_MOVE)
  88. # if !defined(BOOST_ASIO_DISABLE_MOVE)
  89. # if defined(__clang__)
  90. # if __has_feature(__cxx_rvalue_references__)
  91. # define BOOST_ASIO_HAS_MOVE 1
  92. # endif // __has_feature(__cxx_rvalue_references__)
  93. # elif defined(__GNUC__)
  94. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  95. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  96. # define BOOST_ASIO_HAS_MOVE 1
  97. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  98. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  99. # endif // defined(__GNUC__)
  100. # if defined(BOOST_ASIO_MSVC)
  101. # if (_MSC_VER >= 1700)
  102. # define BOOST_ASIO_HAS_MOVE 1
  103. # endif // (_MSC_VER >= 1700)
  104. # endif // defined(BOOST_ASIO_MSVC)
  105. # if defined(__INTEL_CXX11_MODE__)
  106. # if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
  107. # define BOOST_ASIO_HAS_MOVE 1
  108. # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
  109. # if defined(__ICL) && (__ICL >= 1500)
  110. # define BOOST_ASIO_HAS_MOVE 1
  111. # endif // defined(__ICL) && (__ICL >= 1500)
  112. # endif // defined(__INTEL_CXX11_MODE__)
  113. # endif // !defined(BOOST_ASIO_DISABLE_MOVE)
  114. #endif // !defined(BOOST_ASIO_HAS_MOVE)
  115. // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
  116. // * BOOST_ASIO_MOVE_ARG,
  117. // * BOOST_ASIO_NONDEDUCED_MOVE_ARG, and
  118. // * BOOST_ASIO_MOVE_CAST
  119. // to take advantage of rvalue references and perfect forwarding.
  120. #if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
  121. # define BOOST_ASIO_MOVE_ARG(type) type&&
  122. # define BOOST_ASIO_MOVE_ARG2(type1, type2) type1, type2&&
  123. # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) type&
  124. # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
  125. # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
  126. # define BOOST_ASIO_MOVE_OR_LVALUE(type) static_cast<type&&>
  127. # define BOOST_ASIO_MOVE_OR_LVALUE_ARG(type) type&&
  128. # define BOOST_ASIO_MOVE_OR_LVALUE_TYPE(type) type
  129. #endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
  130. // If BOOST_ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
  131. // implementation. Note that older g++ and MSVC versions don't like it when you
  132. // pass a non-member function through a const reference, so for most compilers
  133. // we'll play it safe and stick with the old approach of passing the handler by
  134. // value.
  135. #if !defined(BOOST_ASIO_MOVE_CAST)
  136. # if defined(__GNUC__)
  137. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
  138. # define BOOST_ASIO_MOVE_ARG(type) const type&
  139. # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
  140. # define BOOST_ASIO_MOVE_ARG(type) type
  141. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
  142. # elif defined(BOOST_ASIO_MSVC)
  143. # if (_MSC_VER >= 1400)
  144. # define BOOST_ASIO_MOVE_ARG(type) const type&
  145. # else // (_MSC_VER >= 1400)
  146. # define BOOST_ASIO_MOVE_ARG(type) type
  147. # endif // (_MSC_VER >= 1400)
  148. # else
  149. # define BOOST_ASIO_MOVE_ARG(type) type
  150. # endif
  151. # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) const type&
  152. # define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
  153. # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
  154. # define BOOST_ASIO_MOVE_OR_LVALUE(type)
  155. # define BOOST_ASIO_MOVE_OR_LVALUE_ARG(type) type&
  156. # define BOOST_ASIO_MOVE_OR_LVALUE_TYPE(type) type&
  157. #endif // !defined(BOOST_ASIO_MOVE_CAST)
  158. // Support variadic templates on compilers known to allow it.
  159. #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  160. # if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
  161. # if defined(__clang__)
  162. # if __has_feature(__cxx_variadic_templates__)
  163. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  164. # endif // __has_feature(__cxx_variadic_templates__)
  165. # elif defined(__GNUC__)
  166. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  167. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  168. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  169. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  170. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  171. # endif // defined(__GNUC__)
  172. # if defined(BOOST_ASIO_MSVC)
  173. # if (_MSC_VER >= 1900)
  174. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  175. # endif // (_MSC_VER >= 1900)
  176. # endif // defined(BOOST_ASIO_MSVC)
  177. # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
  178. #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  179. #if !defined(BOOST_ASIO_ELLIPSIS)
  180. # if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  181. # define BOOST_ASIO_ELLIPSIS ...
  182. # else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  183. # define BOOST_ASIO_ELLIPSIS
  184. # endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  185. #endif // !defined(BOOST_ASIO_ELLIPSIS)
  186. // Support deleted functions on compilers known to allow it.
  187. #if !defined(BOOST_ASIO_DELETED)
  188. # if defined(__clang__)
  189. # if __has_feature(__cxx_deleted_functions__)
  190. # define BOOST_ASIO_DELETED = delete
  191. # endif // __has_feature(__cxx_deleted_functions__)
  192. # elif defined(__GNUC__)
  193. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  194. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  195. # define BOOST_ASIO_DELETED = delete
  196. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  197. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  198. # endif // defined(__GNUC__)
  199. # if defined(BOOST_ASIO_MSVC)
  200. # if (_MSC_VER >= 1900)
  201. # define BOOST_ASIO_DELETED = delete
  202. # endif // (_MSC_VER >= 1900)
  203. # endif // defined(BOOST_ASIO_MSVC)
  204. # if !defined(BOOST_ASIO_DELETED)
  205. # define BOOST_ASIO_DELETED
  206. # endif // !defined(BOOST_ASIO_DELETED)
  207. #endif // !defined(BOOST_ASIO_DELETED)
  208. // Support constexpr on compilers known to allow it.
  209. #if !defined(BOOST_ASIO_HAS_CONSTEXPR)
  210. # if !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
  211. # if defined(__clang__)
  212. # if __has_feature(__cxx_constexpr__)
  213. # define BOOST_ASIO_HAS_CONSTEXPR 1
  214. # endif // __has_feature(__cxx_constexpr__)
  215. # elif defined(__GNUC__)
  216. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  217. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  218. # define BOOST_ASIO_HAS_CONSTEXPR 1
  219. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  220. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  221. # endif // defined(__GNUC__)
  222. # if defined(BOOST_ASIO_MSVC)
  223. # if (_MSC_VER >= 1900)
  224. # define BOOST_ASIO_HAS_CONSTEXPR 1
  225. # endif // (_MSC_VER >= 1900)
  226. # endif // defined(BOOST_ASIO_MSVC)
  227. # endif // !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
  228. #endif // !defined(BOOST_ASIO_HAS_CONSTEXPR)
  229. #if !defined(BOOST_ASIO_CONSTEXPR)
  230. # if defined(BOOST_ASIO_HAS_CONSTEXPR)
  231. # define BOOST_ASIO_CONSTEXPR constexpr
  232. # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
  233. # define BOOST_ASIO_CONSTEXPR
  234. # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
  235. #endif // !defined(BOOST_ASIO_CONSTEXPR)
  236. #if !defined(BOOST_ASIO_STATIC_CONSTEXPR)
  237. # if defined(BOOST_ASIO_HAS_CONSTEXPR)
  238. # define BOOST_ASIO_STATIC_CONSTEXPR(type, assignment) \
  239. static constexpr type assignment
  240. # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
  241. # define BOOST_ASIO_STATIC_CONSTEXPR(type, assignment) \
  242. static const type assignment
  243. # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
  244. #endif // !defined(BOOST_ASIO_STATIC_CONSTEXPR)
  245. #if !defined(BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
  246. # if defined(BOOST_ASIO_HAS_CONSTEXPR)
  247. # if defined(__GNUC__)
  248. # if (__GNUC__ >= 8)
  249. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  250. static constexpr const type name{}
  251. # else // (__GNUC__ >= 8)
  252. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  253. static const type name
  254. # endif // (__GNUC__ >= 8)
  255. # elif defined(BOOST_ASIO_MSVC)
  256. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  257. static const type name
  258. # else // defined(BOOST_ASIO_MSVC)
  259. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  260. static constexpr const type name{}
  261. # endif // defined(BOOST_ASIO_MSVC)
  262. # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
  263. # define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
  264. static const type name
  265. # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
  266. #endif // !defined(BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
  267. // Support noexcept on compilers known to allow it.
  268. #if !defined(BOOST_ASIO_HAS_NOEXCEPT)
  269. # if !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
  270. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
  271. # if !defined(BOOST_NO_NOEXCEPT)
  272. # define BOOST_ASIO_HAS_NOEXCEPT 1
  273. # endif // !defined(BOOST_NO_NOEXCEPT)
  274. # define BOOST_ASIO_NOEXCEPT BOOST_NOEXCEPT
  275. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW
  276. # define BOOST_ASIO_NOEXCEPT_IF(c) BOOST_NOEXCEPT_IF(c)
  277. # elif defined(__clang__)
  278. # if __has_feature(__cxx_noexcept__)
  279. # define BOOST_ASIO_HAS_NOEXCEPT 1
  280. # endif // __has_feature(__cxx_noexcept__)
  281. # elif defined(__GNUC__)
  282. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  283. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  284. # define BOOST_ASIO_HAS_NOEXCEPT 1
  285. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  286. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  287. # elif defined(BOOST_ASIO_MSVC)
  288. # if (_MSC_VER >= 1900)
  289. # define BOOST_ASIO_HAS_NOEXCEPT 1
  290. # endif // (_MSC_VER >= 1900)
  291. # endif // defined(BOOST_ASIO_MSVC)
  292. # endif // !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
  293. # if !defined(BOOST_ASIO_NOEXCEPT)
  294. # endif // !defined(BOOST_ASIO_NOEXCEPT)
  295. # if !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
  296. # endif // !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
  297. #endif // !defined(BOOST_ASIO_HAS_NOEXCEPT)
  298. #if !defined(BOOST_ASIO_NOEXCEPT)
  299. # if defined(BOOST_ASIO_HAS_NOEXCEPT)
  300. # define BOOST_ASIO_NOEXCEPT noexcept(true)
  301. # else // defined(BOOST_ASIO_HAS_NOEXCEPT)
  302. # define BOOST_ASIO_NOEXCEPT
  303. # endif // defined(BOOST_ASIO_HAS_NOEXCEPT)
  304. #endif // !defined(BOOST_ASIO_NOEXCEPT)
  305. #if !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
  306. # if defined(BOOST_ASIO_HAS_NOEXCEPT)
  307. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
  308. # else // defined(BOOST_ASIO_HAS_NOEXCEPT)
  309. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW throw()
  310. # endif // defined(BOOST_ASIO_HAS_NOEXCEPT)
  311. #endif // !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
  312. #if !defined(BOOST_ASIO_NOEXCEPT_IF)
  313. # if defined(BOOST_ASIO_HAS_NOEXCEPT)
  314. # define BOOST_ASIO_NOEXCEPT_IF(c) noexcept(c)
  315. # else // defined(BOOST_ASIO_HAS_NOEXCEPT)
  316. # define BOOST_ASIO_NOEXCEPT_IF(c)
  317. # endif // defined(BOOST_ASIO_HAS_NOEXCEPT)
  318. #endif // !defined(BOOST_ASIO_NOEXCEPT_IF)
  319. // Support noexcept on function types on compilers known to allow it.
  320. #if !defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
  321. # if !defined(BOOST_ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE)
  322. # if defined(__clang__)
  323. # if (__cplusplus >= 202002)
  324. # define BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE 1
  325. # endif // (__cplusplus >= 202002)
  326. # elif defined(__GNUC__)
  327. # if (__cplusplus >= 202002)
  328. # define BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE 1
  329. # endif // (__cplusplus >= 202002)
  330. # elif defined(BOOST_ASIO_MSVC)
  331. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 202002)
  332. # define BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE 1
  333. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 202002)
  334. # endif // defined(BOOST_ASIO_MSVC)
  335. # endif // !defined(BOOST_ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE)
  336. #endif // !defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
  337. // Support automatic type deduction on compilers known to support it.
  338. #if !defined(BOOST_ASIO_HAS_DECLTYPE)
  339. # if !defined(BOOST_ASIO_DISABLE_DECLTYPE)
  340. # if defined(__clang__)
  341. # if __has_feature(__cxx_decltype__)
  342. # define BOOST_ASIO_HAS_DECLTYPE 1
  343. # endif // __has_feature(__cxx_decltype__)
  344. # elif defined(__GNUC__)
  345. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  346. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  347. # define BOOST_ASIO_HAS_DECLTYPE 1
  348. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  349. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  350. # endif // defined(__GNUC__)
  351. # if defined(BOOST_ASIO_MSVC)
  352. # if (_MSC_VER >= 1800)
  353. # define BOOST_ASIO_HAS_DECLTYPE 1
  354. # endif // (_MSC_VER >= 1800)
  355. # endif // defined(BOOST_ASIO_MSVC)
  356. # endif // !defined(BOOST_ASIO_DISABLE_DECLTYPE)
  357. #endif // !defined(BOOST_ASIO_HAS_DECLTYPE)
  358. #if defined(BOOST_ASIO_HAS_DECLTYPE)
  359. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX(t) auto
  360. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX2(t0, t1) auto
  361. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX3(t0, t1, t2) auto
  362. # define BOOST_ASIO_AUTO_RETURN_TYPE_SUFFIX(expr) -> decltype expr
  363. #else // defined(BOOST_ASIO_HAS_DECLTYPE)
  364. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX(t) t
  365. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX2(t0, t1) t0, t1
  366. # define BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX3(t0, t1, t2) t0, t1, t2
  367. # define BOOST_ASIO_AUTO_RETURN_TYPE_SUFFIX(expr)
  368. #endif // defined(BOOST_ASIO_HAS_DECLTYPE)
  369. // Support alias templates on compilers known to allow it.
  370. #if !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
  371. # if !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
  372. # if defined(__clang__)
  373. # if __has_feature(__cxx_alias_templates__)
  374. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  375. # endif // __has_feature(__cxx_alias_templates__)
  376. # elif defined(__GNUC__)
  377. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  378. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  379. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  380. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  381. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  382. # endif // defined(__GNUC__)
  383. # if defined(BOOST_ASIO_MSVC)
  384. # if (_MSC_VER >= 1900)
  385. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  386. # endif // (_MSC_VER >= 1900)
  387. # endif // defined(BOOST_ASIO_MSVC)
  388. # endif // !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
  389. #endif // !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
  390. // Support return type deduction on compilers known to allow it.
  391. #if !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
  392. # if !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
  393. # if defined(__clang__)
  394. # if __has_feature(__cxx_return_type_deduction__)
  395. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  396. # endif // __has_feature(__cxx_return_type_deduction__)
  397. # elif (__cplusplus >= 201402)
  398. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  399. # elif defined(__cpp_return_type_deduction)
  400. # if (__cpp_return_type_deduction >= 201304)
  401. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  402. # endif // (__cpp_return_type_deduction >= 201304)
  403. # elif defined(BOOST_ASIO_MSVC)
  404. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 201402)
  405. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  406. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201402)
  407. # endif // defined(BOOST_ASIO_MSVC)
  408. # endif // !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
  409. #endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
  410. // Support default function template arguments on compilers known to allow it.
  411. #if !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  412. # if !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  413. # if (__cplusplus >= 201103)
  414. # define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
  415. # elif defined(BOOST_ASIO_MSVC)
  416. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
  417. # define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
  418. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
  419. # endif // defined(BOOST_ASIO_MSVC)
  420. # endif // !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  421. #endif // !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  422. // Support enum classes on compilers known to allow them.
  423. #if !defined(BOOST_ASIO_HAS_ENUM_CLASS)
  424. # if !defined(BOOST_ASIO_DISABLE_ENUM_CLASS)
  425. # if (__cplusplus >= 201103)
  426. # define BOOST_ASIO_HAS_ENUM_CLASS 1
  427. # elif defined(BOOST_ASIO_MSVC)
  428. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
  429. # define BOOST_ASIO_HAS_ENUM_CLASS 1
  430. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
  431. # endif // defined(BOOST_ASIO_MSVC)
  432. # endif // !defined(BOOST_ASIO_DISABLE_ENUM_CLASS)
  433. #endif // !defined(BOOST_ASIO_HAS_ENUM_CLASS)
  434. // Support concepts on compilers known to allow them.
  435. #if !defined(BOOST_ASIO_HAS_CONCEPTS)
  436. # if !defined(BOOST_ASIO_DISABLE_CONCEPTS)
  437. # if defined(__cpp_concepts)
  438. # define BOOST_ASIO_HAS_CONCEPTS 1
  439. # if (__cpp_concepts >= 201707)
  440. # define BOOST_ASIO_CONCEPT concept
  441. # else // (__cpp_concepts >= 201707)
  442. # define BOOST_ASIO_CONCEPT concept bool
  443. # endif // (__cpp_concepts >= 201707)
  444. # endif // defined(__cpp_concepts)
  445. # endif // !defined(BOOST_ASIO_DISABLE_CONCEPTS)
  446. #endif // !defined(BOOST_ASIO_HAS_CONCEPTS)
  447. // Support concepts on compilers known to allow them.
  448. #if !defined(BOOST_ASIO_HAS_STD_CONCEPTS)
  449. # if !defined(BOOST_ASIO_DISABLE_STD_CONCEPTS)
  450. # if defined(BOOST_ASIO_HAS_CONCEPTS)
  451. # if (__cpp_lib_concepts >= 202002L)
  452. # define BOOST_ASIO_HAS_STD_CONCEPTS 1
  453. # endif // (__cpp_concepts >= 202002L)
  454. # endif // defined(BOOST_ASIO_HAS_CONCEPTS)
  455. # endif // !defined(BOOST_ASIO_DISABLE_STD_CONCEPTS)
  456. #endif // !defined(BOOST_ASIO_HAS_STD_CONCEPTS)
  457. // Support template variables on compilers known to allow it.
  458. #if !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  459. # if !defined(BOOST_ASIO_DISABLE_VARIABLE_TEMPLATES)
  460. # if defined(__clang__)
  461. # if (__cplusplus >= 201402)
  462. # if __has_feature(__cxx_variable_templates__)
  463. # define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
  464. # endif // __has_feature(__cxx_variable_templates__)
  465. # endif // (__cplusplus >= 201402)
  466. # elif defined(__GNUC__) && !defined(__INTEL_COMPILER)
  467. # if (__GNUC__ >= 6)
  468. # if (__cplusplus >= 201402)
  469. # define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
  470. # endif // (__cplusplus >= 201402)
  471. # endif // (__GNUC__ >= 6)
  472. # endif // defined(__GNUC__) && !defined(__INTEL_COMPILER)
  473. # if defined(BOOST_ASIO_MSVC)
  474. # if (_MSC_VER >= 1901)
  475. # define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
  476. # endif // (_MSC_VER >= 1901)
  477. # endif // defined(BOOST_ASIO_MSVC)
  478. # endif // !defined(BOOST_ASIO_DISABLE_VARIABLE_TEMPLATES)
  479. #endif // !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  480. // Support SFINAEd template variables on compilers known to allow it.
  481. #if !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  482. # if !defined(BOOST_ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES)
  483. # if defined(__clang__)
  484. # if (__cplusplus >= 201703)
  485. # if __has_feature(__cxx_variable_templates__)
  486. # define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
  487. # endif // __has_feature(__cxx_variable_templates__)
  488. # endif // (__cplusplus >= 201703)
  489. # elif defined(__GNUC__)
  490. # if ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8)
  491. # if (__cplusplus >= 201402)
  492. # define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
  493. # endif // (__cplusplus >= 201402)
  494. # endif // ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8)
  495. # endif // defined(__GNUC__)
  496. # if defined(BOOST_ASIO_MSVC)
  497. # if (_MSC_VER >= 1901)
  498. # define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
  499. # endif // (_MSC_VER >= 1901)
  500. # endif // defined(BOOST_ASIO_MSVC)
  501. # endif // !defined(BOOST_ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES)
  502. #endif // !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  503. // Support SFINAE use of constant expressions on compilers known to allow it.
  504. #if !defined(BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
  505. # if !defined(BOOST_ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE)
  506. # if defined(__clang__)
  507. # if (__cplusplus >= 201402)
  508. # define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
  509. # endif // (__cplusplus >= 201402)
  510. # elif defined(__GNUC__) && !defined(__INTEL_COMPILER)
  511. # if (__GNUC__ >= 7)
  512. # if (__cplusplus >= 201402)
  513. # define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
  514. # endif // (__cplusplus >= 201402)
  515. # endif // (__GNUC__ >= 7)
  516. # endif // defined(__GNUC__) && !defined(__INTEL_COMPILER)
  517. # if defined(BOOST_ASIO_MSVC)
  518. # if (_MSC_VER >= 1901)
  519. # define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
  520. # endif // (_MSC_VER >= 1901)
  521. # endif // defined(BOOST_ASIO_MSVC)
  522. # endif // !defined(BOOST_ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE)
  523. #endif // !defined(BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
  524. // Enable workarounds for lack of working expression SFINAE.
  525. #if !defined(BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE)
  526. # if !defined(BOOST_ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
  527. # if !defined(BOOST_ASIO_MSVC) && !defined(__INTEL_COMPILER)
  528. # if (__cplusplus >= 201103)
  529. # define BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE 1
  530. # endif // (__cplusplus >= 201103)
  531. # elif defined(BOOST_ASIO_MSVC) && (_MSC_VER >= 1929)
  532. # if (_MSVC_LANG >= 202000)
  533. # define BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE 1
  534. # endif // (_MSVC_LANG >= 202000)
  535. # endif // defined(BOOST_ASIO_MSVC) && (_MSC_VER >= 1929)
  536. # endif // !defined(BOOST_ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
  537. #endif // !defined(BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE)
  538. // Support ref-qualified functions on compilers known to allow it.
  539. #if !defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
  540. # if !defined(BOOST_ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS)
  541. # if defined(__clang__)
  542. # if __has_feature(__cxx_reference_qualified_functions__)
  543. # define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
  544. # endif // __has_feature(__cxx_reference_qualified_functions__)
  545. # elif defined(__GNUC__)
  546. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  547. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  548. # define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
  549. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  550. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  551. # endif // defined(__GNUC__)
  552. # if defined(BOOST_ASIO_MSVC)
  553. # if (_MSC_VER >= 1900)
  554. # define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
  555. # endif // (_MSC_VER >= 1900)
  556. # endif // defined(BOOST_ASIO_MSVC)
  557. # endif // !defined(BOOST_ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS)
  558. #endif // !defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
  559. #if defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
  560. # if !defined(BOOST_ASIO_LVALUE_REF_QUAL)
  561. # define BOOST_ASIO_LVALUE_REF_QUAL &
  562. # endif // !defined(BOOST_ASIO_LVALUE_REF_QUAL)
  563. # if !defined(BOOST_ASIO_RVALUE_REF_QUAL)
  564. # define BOOST_ASIO_RVALUE_REF_QUAL &&
  565. # endif // !defined(BOOST_ASIO_RVALUE_REF_QUAL)
  566. #else // defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
  567. # if !defined(BOOST_ASIO_LVALUE_REF_QUAL)
  568. # define BOOST_ASIO_LVALUE_REF_QUAL
  569. # endif // !defined(BOOST_ASIO_LVALUE_REF_QUAL)
  570. # if !defined(BOOST_ASIO_RVALUE_REF_QUAL)
  571. # define BOOST_ASIO_RVALUE_REF_QUAL
  572. # endif // !defined(BOOST_ASIO_RVALUE_REF_QUAL)
  573. #endif // defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
  574. // Support for capturing parameter packs in lambdas.
  575. #if !defined(BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
  576. # if !defined(BOOST_ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
  577. # if defined(__GNUC__)
  578. # if (__GNUC__ >= 6)
  579. # define BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
  580. # endif // (__GNUC__ >= 6)
  581. # elif defined(BOOST_ASIO_MSVC)
  582. # if (_MSVC_LANG >= 201103)
  583. # define BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
  584. # endif // (_MSC_LANG >= 201103)
  585. # else // defined(BOOST_ASIO_MSVC)
  586. # if (__cplusplus >= 201103)
  587. # define BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES 1
  588. # endif // (__cplusplus >= 201103)
  589. # endif // defined(BOOST_ASIO_MSVC)
  590. # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
  591. #endif // !defined(BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
  592. // Support for the alignof operator.
  593. #if !defined(BOOST_ASIO_HAS_ALIGNOF)
  594. # if !defined(BOOST_ASIO_DISABLE_ALIGNOF)
  595. # if (__cplusplus >= 201103)
  596. # define BOOST_ASIO_HAS_ALIGNOF 1
  597. # endif // (__cplusplus >= 201103)
  598. # endif // !defined(BOOST_ASIO_DISABLE_ALIGNOF)
  599. #endif // !defined(BOOST_ASIO_HAS_ALIGNOF)
  600. #if defined(BOOST_ASIO_HAS_ALIGNOF)
  601. # define BOOST_ASIO_ALIGNOF(T) alignof(T)
  602. # if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
  603. # define BOOST_ASIO_DEFAULT_ALIGN __STDCPP_DEFAULT_NEW_ALIGNMENT__
  604. # elif defined(__GNUC__)
  605. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  606. # define BOOST_ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
  607. # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  608. # define BOOST_ASIO_DEFAULT_ALIGN alignof(max_align_t)
  609. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  610. # else // defined(__GNUC__)
  611. # define BOOST_ASIO_DEFAULT_ALIGN alignof(std::max_align_t)
  612. # endif // defined(__GNUC__)
  613. #else // defined(BOOST_ASIO_HAS_ALIGNOF)
  614. # define BOOST_ASIO_ALIGNOF(T) 1
  615. # define BOOST_ASIO_DEFAULT_ALIGN 1
  616. #endif // defined(BOOST_ASIO_HAS_ALIGNOF)
  617. // Support for user-defined literals.
  618. #if !defined(BOOST_ASIO_HAS_USER_DEFINED_LITERALS)
  619. # if !defined(BOOST_ASIO_DISABLE_USER_DEFINED_LITERALS)
  620. # if (__cplusplus >= 201103)
  621. # define BOOST_ASIO_HAS_USER_DEFINED_LITERALS 1
  622. # elif defined(BOOST_ASIO_MSVC)
  623. # if (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
  624. # define BOOST_ASIO_HAS_USER_DEFINED_LITERALS 1
  625. # endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
  626. # endif // defined(BOOST_ASIO_MSVC)
  627. # endif // !defined(BOOST_ASIO_DISABLE_USER_DEFINED_LITERALS)
  628. #endif // !defined(BOOST_ASIO_HAS_USER_DEFINED_LITERALS)
  629. // Standard library support for aligned allocation.
  630. #if !defined(BOOST_ASIO_HAS_STD_ALIGNED_ALLOC)
  631. # if !defined(BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC)
  632. # if (__cplusplus >= 201703)
  633. # if defined(__clang__)
  634. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  635. # if (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) \
  636. && !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
  637. # if defined(__APPLE__)
  638. # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  639. # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
  640. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  641. # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
  642. # elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
  643. # if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
  644. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  645. # endif // (__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
  646. # elif defined(__TV_OS_VERSION_MIN_REQUIRED)
  647. # if (__TV_OS_VERSION_MIN_REQUIRED >= 130000)
  648. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  649. # endif // (__TV_OS_VERSION_MIN_REQUIRED >= 130000)
  650. # elif defined(__WATCH_OS_VERSION_MIN_REQUIRED)
  651. # if (__WATCH_OS_VERSION_MIN_REQUIRED >= 60000)
  652. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  653. # endif // (__WATCH_OS_VERSION_MIN_REQUIRED >= 60000)
  654. # endif // defined(__WATCH_OS_X_VERSION_MIN_REQUIRED)
  655. # else // defined(__APPLE__)
  656. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  657. # endif // defined(__APPLE__)
  658. # endif // (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC)
  659. // && !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
  660. # elif defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  661. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  662. # endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  663. # elif defined(__GNUC__)
  664. # if ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 7)
  665. # if defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  666. # define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
  667. # endif // defined(_GLIBCXX_HAVE_ALIGNED_ALLOC)
  668. # endif // ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 7)
  669. # endif // defined(__GNUC__)
  670. # endif // (__cplusplus >= 201703)
  671. # endif // !defined(BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC)
  672. #endif // !defined(BOOST_ASIO_HAS_STD_ALIGNED_ALLOC)
  673. // Standard library support for std::align.
  674. #if !defined(BOOST_ASIO_HAS_STD_ALIGN)
  675. # if !defined(BOOST_ASIO_DISABLE_STD_ALIGN)
  676. # if defined(__clang__)
  677. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  678. # define BOOST_ASIO_HAS_STD_ALIGN 1
  679. # elif (__cplusplus >= 201103)
  680. # define BOOST_ASIO_HAS_STD_ALIGN 1
  681. # endif // (__cplusplus >= 201103)
  682. # elif defined(__GNUC__)
  683. # if (__GNUC__ >= 6)
  684. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  685. # define BOOST_ASIO_HAS_STD_ALIGN 1
  686. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  687. # endif // (__GNUC__ >= 6)
  688. # endif // defined(__GNUC__)
  689. # if defined(BOOST_ASIO_MSVC)
  690. # if (_MSC_VER >= 1700)
  691. # define BOOST_ASIO_HAS_STD_ALIGN 1
  692. # endif // (_MSC_VER >= 1700)
  693. # endif // defined(BOOST_ASIO_MSVC)
  694. # endif // !defined(BOOST_ASIO_DISABLE_STD_ALIGN)
  695. #endif // !defined(BOOST_ASIO_HAS_STD_ALIGN)
  696. // Standard library support for system errors.
  697. # if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
  698. # if defined(__clang__)
  699. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  700. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  701. # elif (__cplusplus >= 201103)
  702. # if __has_include(<system_error>)
  703. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  704. # endif // __has_include(<system_error>)
  705. # endif // (__cplusplus >= 201103)
  706. # elif defined(__GNUC__)
  707. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  708. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  709. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  710. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  711. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  712. # endif // defined(__GNUC__)
  713. # if defined(BOOST_ASIO_MSVC)
  714. # if (_MSC_VER >= 1700)
  715. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  716. # endif // (_MSC_VER >= 1700)
  717. # endif // defined(BOOST_ASIO_MSVC)
  718. # endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
  719. // Compliant C++11 compilers put noexcept specifiers on error_category members.
  720. #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  721. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
  722. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
  723. # elif defined(__clang__)
  724. # if __has_feature(__cxx_noexcept__)
  725. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  726. # endif // __has_feature(__cxx_noexcept__)
  727. # elif defined(__GNUC__)
  728. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  729. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  730. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  731. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  732. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  733. # elif defined(BOOST_ASIO_MSVC)
  734. # if (_MSC_VER >= 1900)
  735. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  736. # endif // (_MSC_VER >= 1900)
  737. # endif // defined(BOOST_ASIO_MSVC)
  738. # if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  739. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
  740. # endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  741. #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  742. // Standard library support for arrays.
  743. #if !defined(BOOST_ASIO_HAS_STD_ARRAY)
  744. # if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
  745. # if defined(__clang__)
  746. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  747. # define BOOST_ASIO_HAS_STD_ARRAY 1
  748. # elif (__cplusplus >= 201103)
  749. # if __has_include(<array>)
  750. # define BOOST_ASIO_HAS_STD_ARRAY 1
  751. # endif // __has_include(<array>)
  752. # endif // (__cplusplus >= 201103)
  753. # elif defined(__GNUC__)
  754. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  755. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  756. # define BOOST_ASIO_HAS_STD_ARRAY 1
  757. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  758. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  759. # endif // defined(__GNUC__)
  760. # if defined(BOOST_ASIO_MSVC)
  761. # if (_MSC_VER >= 1600)
  762. # define BOOST_ASIO_HAS_STD_ARRAY 1
  763. # endif // (_MSC_VER >= 1600)
  764. # endif // defined(BOOST_ASIO_MSVC)
  765. # endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
  766. #endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
  767. // Standard library support for shared_ptr and weak_ptr.
  768. #if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
  769. # if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
  770. # if defined(__clang__)
  771. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  772. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  773. # elif (__cplusplus >= 201103)
  774. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  775. # endif // (__cplusplus >= 201103)
  776. # elif defined(__GNUC__)
  777. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  778. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  779. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  780. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  781. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  782. # endif // defined(__GNUC__)
  783. # if defined(BOOST_ASIO_MSVC)
  784. # if (_MSC_VER >= 1600)
  785. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  786. # endif // (_MSC_VER >= 1600)
  787. # endif // defined(BOOST_ASIO_MSVC)
  788. # endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
  789. #endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
  790. // Standard library support for allocator_arg_t.
  791. #if !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
  792. # if !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
  793. # if defined(__clang__)
  794. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  795. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  796. # elif (__cplusplus >= 201103)
  797. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  798. # endif // (__cplusplus >= 201103)
  799. # elif defined(__GNUC__)
  800. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  801. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  802. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  803. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  804. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  805. # endif // defined(__GNUC__)
  806. # if defined(BOOST_ASIO_MSVC)
  807. # if (_MSC_VER >= 1600)
  808. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  809. # endif // (_MSC_VER >= 1600)
  810. # endif // defined(BOOST_ASIO_MSVC)
  811. # endif // !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
  812. #endif // !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
  813. // Standard library support for atomic operations.
  814. #if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
  815. # if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
  816. # if defined(__clang__)
  817. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  818. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  819. # elif (__cplusplus >= 201103)
  820. # if __has_include(<atomic>)
  821. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  822. # endif // __has_include(<atomic>)
  823. # elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
  824. # if (__clang_major__ >= 10)
  825. # if __has_include(<atomic>)
  826. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  827. # endif // __has_include(<atomic>)
  828. # endif // (__clang_major__ >= 10)
  829. # endif // defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
  830. # elif defined(__GNUC__)
  831. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  832. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  833. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  834. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  835. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  836. # endif // defined(__GNUC__)
  837. # if defined(BOOST_ASIO_MSVC)
  838. # if (_MSC_VER >= 1700)
  839. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  840. # endif // (_MSC_VER >= 1700)
  841. # endif // defined(BOOST_ASIO_MSVC)
  842. # endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
  843. #endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
  844. // Standard library support for chrono. Some standard libraries (such as the
  845. // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
  846. // drafts, rather than the eventually standardised name of steady_clock.
  847. #if !defined(BOOST_ASIO_HAS_STD_CHRONO)
  848. # if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
  849. # if defined(__clang__)
  850. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  851. # define BOOST_ASIO_HAS_STD_CHRONO 1
  852. # elif (__cplusplus >= 201103)
  853. # if __has_include(<chrono>)
  854. # define BOOST_ASIO_HAS_STD_CHRONO 1
  855. # endif // __has_include(<chrono>)
  856. # endif // (__cplusplus >= 201103)
  857. # elif defined(__GNUC__)
  858. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  859. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  860. # define BOOST_ASIO_HAS_STD_CHRONO 1
  861. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
  862. # define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
  863. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
  864. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  865. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  866. # endif // defined(__GNUC__)
  867. # if defined(BOOST_ASIO_MSVC)
  868. # if (_MSC_VER >= 1700)
  869. # define BOOST_ASIO_HAS_STD_CHRONO 1
  870. # endif // (_MSC_VER >= 1700)
  871. # endif // defined(BOOST_ASIO_MSVC)
  872. # endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
  873. #endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
  874. // Boost support for chrono.
  875. #if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  876. # if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
  877. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
  878. # define BOOST_ASIO_HAS_BOOST_CHRONO 1
  879. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
  880. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
  881. #endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  882. // Some form of chrono library is available.
  883. #if !defined(BOOST_ASIO_HAS_CHRONO)
  884. # if defined(BOOST_ASIO_HAS_STD_CHRONO) \
  885. || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  886. # define BOOST_ASIO_HAS_CHRONO 1
  887. # endif // defined(BOOST_ASIO_HAS_STD_CHRONO)
  888. // || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  889. #endif // !defined(BOOST_ASIO_HAS_CHRONO)
  890. // Boost support for the DateTime library.
  891. #if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  892. # if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
  893. # define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
  894. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
  895. #endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  896. // Boost support for the Coroutine library.
  897. #if !defined(BOOST_ASIO_HAS_BOOST_COROUTINE)
  898. # if !defined(BOOST_ASIO_DISABLE_BOOST_COROUTINE)
  899. # define BOOST_ASIO_HAS_BOOST_COROUTINE 1
  900. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_COROUTINE)
  901. #endif // !defined(BOOST_ASIO_HAS_BOOST_COROUTINE)
  902. // Boost support for the Context library's fibers.
  903. #if !defined(BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER)
  904. # if !defined(BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER)
  905. # if defined(__clang__)
  906. # if (__cplusplus >= 201103)
  907. # define BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER 1
  908. # endif // (__cplusplus >= 201103)
  909. # elif defined(__GNUC__)
  910. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  911. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  912. # define BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER 1
  913. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  914. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  915. # endif // defined(__GNUC__)
  916. # if defined(BOOST_ASIO_MSVC)
  917. # if (_MSVC_LANG >= 201103)
  918. # define BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER 1
  919. # endif // (_MSC_LANG >= 201103)
  920. # endif // defined(BOOST_ASIO_MSVC)
  921. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER)
  922. #endif // !defined(BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER)
  923. // Standard library support for addressof.
  924. #if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
  925. # if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
  926. # if defined(__clang__)
  927. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  928. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  929. # elif (__cplusplus >= 201103)
  930. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  931. # endif // (__cplusplus >= 201103)
  932. # elif defined(__GNUC__)
  933. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  934. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  935. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  936. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  937. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  938. # endif // defined(__GNUC__)
  939. # if defined(BOOST_ASIO_MSVC)
  940. # if (_MSC_VER >= 1700)
  941. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  942. # endif // (_MSC_VER >= 1700)
  943. # endif // defined(BOOST_ASIO_MSVC)
  944. # endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
  945. #endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
  946. // Standard library support for the function class.
  947. #if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
  948. # if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
  949. # if defined(__clang__)
  950. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  951. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  952. # elif (__cplusplus >= 201103)
  953. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  954. # endif // (__cplusplus >= 201103)
  955. # elif defined(__GNUC__)
  956. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  957. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  958. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  959. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  960. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  961. # endif // defined(__GNUC__)
  962. # if defined(BOOST_ASIO_MSVC)
  963. # if (_MSC_VER >= 1700)
  964. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  965. # endif // (_MSC_VER >= 1700)
  966. # endif // defined(BOOST_ASIO_MSVC)
  967. # endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
  968. #endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
  969. // Standard library support for the reference_wrapper class.
  970. #if !defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER)
  971. # if !defined(BOOST_ASIO_DISABLE_STD_REFERENCE_WRAPPER)
  972. # if defined(__clang__)
  973. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  974. # define BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER 1
  975. # elif (__cplusplus >= 201103)
  976. # define BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER 1
  977. # endif // (__cplusplus >= 201103)
  978. # elif defined(__GNUC__)
  979. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  980. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  981. # define BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER 1
  982. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  983. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  984. # endif // defined(__GNUC__)
  985. # if defined(BOOST_ASIO_MSVC)
  986. # if (_MSC_VER >= 1700)
  987. # define BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER 1
  988. # endif // (_MSC_VER >= 1700)
  989. # endif // defined(BOOST_ASIO_MSVC)
  990. # endif // !defined(BOOST_ASIO_DISABLE_STD_REFERENCE_WRAPPER)
  991. #endif // !defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER)
  992. // Standard library support for type traits.
  993. #if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
  994. # if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
  995. # if defined(__clang__)
  996. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  997. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  998. # elif (__cplusplus >= 201103)
  999. # if __has_include(<type_traits>)
  1000. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  1001. # endif // __has_include(<type_traits>)
  1002. # endif // (__cplusplus >= 201103)
  1003. # elif defined(__GNUC__)
  1004. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1005. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1006. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  1007. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1008. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1009. # endif // defined(__GNUC__)
  1010. # if defined(BOOST_ASIO_MSVC)
  1011. # if (_MSC_VER >= 1700)
  1012. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  1013. # endif // (_MSC_VER >= 1700)
  1014. # endif // defined(BOOST_ASIO_MSVC)
  1015. # endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
  1016. #endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
  1017. // Standard library support for the nullptr_t type.
  1018. #if !defined(BOOST_ASIO_HAS_NULLPTR)
  1019. # if !defined(BOOST_ASIO_DISABLE_NULLPTR)
  1020. # if defined(__clang__)
  1021. # if __has_feature(__cxx_nullptr__)
  1022. # define BOOST_ASIO_HAS_NULLPTR 1
  1023. # endif // __has_feature(__cxx_nullptr__)
  1024. # elif defined(__GNUC__)
  1025. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  1026. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1027. # define BOOST_ASIO_HAS_NULLPTR 1
  1028. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1029. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  1030. # endif // defined(__GNUC__)
  1031. # if defined(BOOST_ASIO_MSVC)
  1032. # if (_MSC_VER >= 1700)
  1033. # define BOOST_ASIO_HAS_NULLPTR 1
  1034. # endif // (_MSC_VER >= 1700)
  1035. # endif // defined(BOOST_ASIO_MSVC)
  1036. # endif // !defined(BOOST_ASIO_DISABLE_NULLPTR)
  1037. #endif // !defined(BOOST_ASIO_HAS_NULLPTR)
  1038. // Standard library support for the C++11 allocator additions.
  1039. #if !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
  1040. # if !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
  1041. # if defined(__clang__)
  1042. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1043. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  1044. # elif (__cplusplus >= 201103)
  1045. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  1046. # endif // (__cplusplus >= 201103)
  1047. # elif defined(__GNUC__)
  1048. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1049. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1050. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  1051. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1052. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1053. # endif // defined(__GNUC__)
  1054. # if defined(BOOST_ASIO_MSVC)
  1055. # if (_MSC_VER >= 1800)
  1056. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  1057. # endif // (_MSC_VER >= 1800)
  1058. # endif // defined(BOOST_ASIO_MSVC)
  1059. # endif // !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
  1060. #endif // !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
  1061. // Standard library support for the cstdint header.
  1062. #if !defined(BOOST_ASIO_HAS_CSTDINT)
  1063. # if !defined(BOOST_ASIO_DISABLE_CSTDINT)
  1064. # if defined(__clang__)
  1065. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1066. # define BOOST_ASIO_HAS_CSTDINT 1
  1067. # elif (__cplusplus >= 201103)
  1068. # define BOOST_ASIO_HAS_CSTDINT 1
  1069. # endif // (__cplusplus >= 201103)
  1070. # elif defined(__GNUC__)
  1071. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  1072. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1073. # define BOOST_ASIO_HAS_CSTDINT 1
  1074. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1075. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  1076. # endif // defined(__GNUC__)
  1077. # if defined(BOOST_ASIO_MSVC)
  1078. # if (_MSC_VER >= 1700)
  1079. # define BOOST_ASIO_HAS_CSTDINT 1
  1080. # endif // (_MSC_VER >= 1700)
  1081. # endif // defined(BOOST_ASIO_MSVC)
  1082. # endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
  1083. #endif // !defined(BOOST_ASIO_HAS_CSTDINT)
  1084. // Standard library support for the thread class.
  1085. #if !defined(BOOST_ASIO_HAS_STD_THREAD)
  1086. # if !defined(BOOST_ASIO_DISABLE_STD_THREAD)
  1087. # if defined(__clang__)
  1088. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1089. # define BOOST_ASIO_HAS_STD_THREAD 1
  1090. # elif (__cplusplus >= 201103)
  1091. # if __has_include(<thread>)
  1092. # define BOOST_ASIO_HAS_STD_THREAD 1
  1093. # endif // __has_include(<thread>)
  1094. # endif // (__cplusplus >= 201103)
  1095. # elif defined(__GNUC__)
  1096. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1097. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1098. # define BOOST_ASIO_HAS_STD_THREAD 1
  1099. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1100. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1101. # endif // defined(__GNUC__)
  1102. # if defined(BOOST_ASIO_MSVC)
  1103. # if (_MSC_VER >= 1700)
  1104. # define BOOST_ASIO_HAS_STD_THREAD 1
  1105. # endif // (_MSC_VER >= 1700)
  1106. # endif // defined(BOOST_ASIO_MSVC)
  1107. # endif // !defined(BOOST_ASIO_DISABLE_STD_THREAD)
  1108. #endif // !defined(BOOST_ASIO_HAS_STD_THREAD)
  1109. // Standard library support for the mutex and condition variable classes.
  1110. #if !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
  1111. # if !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
  1112. # if defined(__clang__)
  1113. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1114. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  1115. # elif (__cplusplus >= 201103)
  1116. # if __has_include(<mutex>)
  1117. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  1118. # endif // __has_include(<mutex>)
  1119. # endif // (__cplusplus >= 201103)
  1120. # elif defined(__GNUC__)
  1121. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1122. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1123. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  1124. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1125. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1126. # endif // defined(__GNUC__)
  1127. # if defined(BOOST_ASIO_MSVC)
  1128. # if (_MSC_VER >= 1700)
  1129. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  1130. # endif // (_MSC_VER >= 1700)
  1131. # endif // defined(BOOST_ASIO_MSVC)
  1132. # endif // !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
  1133. #endif // !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
  1134. // Standard library support for the call_once function.
  1135. #if !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
  1136. # if !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
  1137. # if defined(__clang__)
  1138. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1139. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  1140. # elif (__cplusplus >= 201103)
  1141. # if __has_include(<mutex>)
  1142. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  1143. # endif // __has_include(<mutex>)
  1144. # endif // (__cplusplus >= 201103)
  1145. # elif defined(__GNUC__)
  1146. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1147. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1148. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  1149. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1150. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1151. # endif // defined(__GNUC__)
  1152. # if defined(BOOST_ASIO_MSVC)
  1153. # if (_MSC_VER >= 1700)
  1154. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  1155. # endif // (_MSC_VER >= 1700)
  1156. # endif // defined(BOOST_ASIO_MSVC)
  1157. # endif // !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
  1158. #endif // !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
  1159. // Standard library support for futures.
  1160. #if !defined(BOOST_ASIO_HAS_STD_FUTURE)
  1161. # if !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
  1162. # if defined(__clang__)
  1163. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1164. # define BOOST_ASIO_HAS_STD_FUTURE 1
  1165. # elif (__cplusplus >= 201103)
  1166. # if __has_include(<future>)
  1167. # define BOOST_ASIO_HAS_STD_FUTURE 1
  1168. # endif // __has_include(<future>)
  1169. # endif // (__cplusplus >= 201103)
  1170. # elif defined(__GNUC__)
  1171. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1172. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1173. # define BOOST_ASIO_HAS_STD_FUTURE 1
  1174. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1175. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1176. # endif // defined(__GNUC__)
  1177. # if defined(BOOST_ASIO_MSVC)
  1178. # if (_MSC_VER >= 1700)
  1179. # define BOOST_ASIO_HAS_STD_FUTURE 1
  1180. # endif // (_MSC_VER >= 1700)
  1181. # endif // defined(BOOST_ASIO_MSVC)
  1182. # endif // !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
  1183. #endif // !defined(BOOST_ASIO_HAS_STD_FUTURE)
  1184. // Standard library support for std::tuple.
  1185. #if !defined(BOOST_ASIO_HAS_STD_TUPLE)
  1186. # if !defined(BOOST_ASIO_DISABLE_STD_TUPLE)
  1187. # if defined(__clang__)
  1188. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1189. # define BOOST_ASIO_HAS_STD_TUPLE 1
  1190. # elif (__cplusplus >= 201103)
  1191. # if __has_include(<tuple>)
  1192. # define BOOST_ASIO_HAS_STD_TUPLE 1
  1193. # endif // __has_include(<tuple>)
  1194. # endif // (__cplusplus >= 201103)
  1195. # elif defined(__GNUC__)
  1196. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1197. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1198. # define BOOST_ASIO_HAS_STD_TUPLE 1
  1199. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1200. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1201. # endif // defined(__GNUC__)
  1202. # if defined(BOOST_ASIO_MSVC)
  1203. # if (_MSC_VER >= 1700)
  1204. # define BOOST_ASIO_HAS_STD_TUPLE 1
  1205. # endif // (_MSC_VER >= 1700)
  1206. # endif // defined(BOOST_ASIO_MSVC)
  1207. # endif // !defined(BOOST_ASIO_DISABLE_STD_TUPLE)
  1208. #endif // !defined(BOOST_ASIO_HAS_STD_TUPLE)
  1209. // Standard library support for std::string_view.
  1210. #if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  1211. # if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
  1212. # if defined(__clang__)
  1213. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1214. # if (__cplusplus >= 201402)
  1215. # if __has_include(<string_view>)
  1216. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  1217. # endif // __has_include(<string_view>)
  1218. # endif // (__cplusplus >= 201402)
  1219. # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1220. # if (__cplusplus >= 201703)
  1221. # if __has_include(<string_view>)
  1222. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  1223. # endif // __has_include(<string_view>)
  1224. # endif // (__cplusplus >= 201703)
  1225. # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1226. # elif defined(__GNUC__)
  1227. # if (__GNUC__ >= 7)
  1228. # if (__cplusplus >= 201703)
  1229. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  1230. # endif // (__cplusplus >= 201703)
  1231. # endif // (__GNUC__ >= 7)
  1232. # elif defined(BOOST_ASIO_MSVC)
  1233. # if (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
  1234. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  1235. # endif // (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
  1236. # endif // defined(BOOST_ASIO_MSVC)
  1237. # endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
  1238. #endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  1239. // Standard library support for std::experimental::string_view.
  1240. #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  1241. # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
  1242. # if defined(__clang__)
  1243. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1244. # if (_LIBCPP_VERSION < 7000)
  1245. # if (__cplusplus >= 201402)
  1246. # if __has_include(<experimental/string_view>)
  1247. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  1248. # endif // __has_include(<experimental/string_view>)
  1249. # endif // (__cplusplus >= 201402)
  1250. # endif // (_LIBCPP_VERSION < 7000)
  1251. # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1252. # if (__cplusplus >= 201402)
  1253. # if __has_include(<experimental/string_view>)
  1254. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  1255. # endif // __has_include(<experimental/string_view>)
  1256. # endif // (__cplusplus >= 201402)
  1257. # endif // // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1258. # elif defined(__GNUC__)
  1259. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  1260. # if (__cplusplus >= 201402)
  1261. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  1262. # endif // (__cplusplus >= 201402)
  1263. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  1264. # endif // defined(__GNUC__)
  1265. # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
  1266. #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  1267. // Standard library has a string_view that we can use.
  1268. #if !defined(BOOST_ASIO_HAS_STRING_VIEW)
  1269. # if !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
  1270. # if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  1271. # define BOOST_ASIO_HAS_STRING_VIEW 1
  1272. # elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  1273. # define BOOST_ASIO_HAS_STRING_VIEW 1
  1274. # endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  1275. # endif // !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
  1276. #endif // !defined(BOOST_ASIO_HAS_STRING_VIEW)
  1277. // Standard library support for iostream move construction and assignment.
  1278. #if !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
  1279. # if !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
  1280. # if defined(__clang__)
  1281. # if (__cplusplus >= 201103)
  1282. # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
  1283. # endif // (__cplusplus >= 201103)
  1284. # elif defined(__GNUC__)
  1285. # if (__GNUC__ > 4)
  1286. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1287. # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
  1288. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1289. # endif // (__GNUC__ > 4)
  1290. # elif defined(BOOST_ASIO_MSVC)
  1291. # if (_MSC_VER >= 1700)
  1292. # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
  1293. # endif // (_MSC_VER >= 1700)
  1294. # endif // defined(BOOST_ASIO_MSVC)
  1295. # endif // !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
  1296. #endif // !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
  1297. // Standard library has invoke_result (which supersedes result_of).
  1298. #if !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
  1299. # if !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
  1300. # if defined(BOOST_ASIO_MSVC)
  1301. # if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
  1302. # define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
  1303. # endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
  1304. # else // defined(BOOST_ASIO_MSVC)
  1305. # if (__cplusplus >= 201703)
  1306. # define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
  1307. # endif // (__cplusplus >= 201703)
  1308. # endif // defined(BOOST_ASIO_MSVC)
  1309. # endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
  1310. #endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
  1311. // Standard library support for std::exception_ptr and std::current_exception.
  1312. #if !defined(BOOST_ASIO_HAS_STD_EXCEPTION_PTR)
  1313. # if !defined(BOOST_ASIO_DISABLE_STD_EXCEPTION_PTR)
  1314. # if defined(__clang__)
  1315. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1316. # define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
  1317. # elif (__cplusplus >= 201103)
  1318. # define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
  1319. # endif // (__cplusplus >= 201103)
  1320. # elif defined(__GNUC__)
  1321. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1322. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1323. # define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
  1324. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1325. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1326. # endif // defined(__GNUC__)
  1327. # if defined(BOOST_ASIO_MSVC)
  1328. # if (_MSC_VER >= 1800)
  1329. # define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
  1330. # endif // (_MSC_VER >= 1800)
  1331. # endif // defined(BOOST_ASIO_MSVC)
  1332. # endif // !defined(BOOST_ASIO_DISABLE_STD_EXCEPTION_PTR)
  1333. #endif // !defined(BOOST_ASIO_HAS_STD_EXCEPTION_PTR)
  1334. // Standard library support for std::nested_exception.
  1335. #if !defined(BOOST_ASIO_HAS_STD_NESTED_EXCEPTION)
  1336. # if !defined(BOOST_ASIO_DISABLE_STD_NESTED_EXCEPTION)
  1337. # if defined(__clang__)
  1338. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  1339. # define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
  1340. # elif (__cplusplus >= 201103)
  1341. # define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
  1342. # endif // (__cplusplus >= 201103)
  1343. # elif defined(__GNUC__)
  1344. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1345. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1346. # define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
  1347. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  1348. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  1349. # endif // defined(__GNUC__)
  1350. # if defined(BOOST_ASIO_MSVC)
  1351. # if (_MSC_VER >= 1900)
  1352. # define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
  1353. # endif // (_MSC_VER >= 1900)
  1354. # endif // defined(BOOST_ASIO_MSVC)
  1355. # endif // !defined(BOOST_ASIO_DISABLE_STD_NESTED_EXCEPTION)
  1356. #endif // !defined(BOOST_ASIO_HAS_STD_NESTED_EXCEPTION)
  1357. // Standard library support for std::any.
  1358. #if !defined(BOOST_ASIO_HAS_STD_ANY)
  1359. # if !defined(BOOST_ASIO_DISABLE_STD_ANY)
  1360. # if defined(__clang__)
  1361. # if (__cplusplus >= 201703)
  1362. # if __has_include(<any>)
  1363. # define BOOST_ASIO_HAS_STD_ANY 1
  1364. # endif // __has_include(<any>)
  1365. # endif // (__cplusplus >= 201703)
  1366. # elif defined(__GNUC__)
  1367. # if (__GNUC__ >= 7)
  1368. # if (__cplusplus >= 201703)
  1369. # define BOOST_ASIO_HAS_STD_ANY 1
  1370. # endif // (__cplusplus >= 201703)
  1371. # endif // (__GNUC__ >= 7)
  1372. # endif // defined(__GNUC__)
  1373. # if defined(BOOST_ASIO_MSVC)
  1374. # if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  1375. # define BOOST_ASIO_HAS_STD_ANY 1
  1376. # endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  1377. # endif // defined(BOOST_ASIO_MSVC)
  1378. # endif // !defined(BOOST_ASIO_DISABLE_STD_ANY)
  1379. #endif // !defined(BOOST_ASIO_HAS_STD_ANY)
  1380. // Standard library support for std::variant.
  1381. #if !defined(BOOST_ASIO_HAS_STD_VARIANT)
  1382. # if !defined(BOOST_ASIO_DISABLE_STD_VARIANT)
  1383. # if defined(__clang__)
  1384. # if (__cplusplus >= 201703)
  1385. # if __has_include(<variant>)
  1386. # define BOOST_ASIO_HAS_STD_VARIANT 1
  1387. # endif // __has_include(<variant>)
  1388. # endif // (__cplusplus >= 201703)
  1389. # elif defined(__GNUC__)
  1390. # if (__GNUC__ >= 7)
  1391. # if (__cplusplus >= 201703)
  1392. # define BOOST_ASIO_HAS_STD_VARIANT 1
  1393. # endif // (__cplusplus >= 201703)
  1394. # endif // (__GNUC__ >= 7)
  1395. # endif // defined(__GNUC__)
  1396. # if defined(BOOST_ASIO_MSVC)
  1397. # if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  1398. # define BOOST_ASIO_HAS_STD_VARIANT 1
  1399. # endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
  1400. # endif // defined(BOOST_ASIO_MSVC)
  1401. # endif // !defined(BOOST_ASIO_DISABLE_STD_VARIANT)
  1402. #endif // !defined(BOOST_ASIO_HAS_STD_VARIANT)
  1403. // Standard library support for std::source_location.
  1404. #if !defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
  1405. # if !defined(BOOST_ASIO_DISABLE_STD_SOURCE_LOCATION)
  1406. // ...
  1407. # endif // !defined(BOOST_ASIO_DISABLE_STD_SOURCE_LOCATION)
  1408. #endif // !defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
  1409. // Standard library support for std::experimental::source_location.
  1410. #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  1411. # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION)
  1412. # if defined(__GNUC__)
  1413. # if (__cplusplus >= 201709)
  1414. # if __has_include(<experimental/source_location>)
  1415. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION 1
  1416. # endif // __has_include(<experimental/source_location>)
  1417. # endif // (__cplusplus >= 201709)
  1418. # endif // defined(__GNUC__)
  1419. # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION)
  1420. #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  1421. // Standard library has a source_location that we can use.
  1422. #if !defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
  1423. # if !defined(BOOST_ASIO_DISABLE_SOURCE_LOCATION)
  1424. # if defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
  1425. # define BOOST_ASIO_HAS_SOURCE_LOCATION 1
  1426. # elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  1427. # define BOOST_ASIO_HAS_SOURCE_LOCATION 1
  1428. # endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
  1429. # endif // !defined(BOOST_ASIO_DISABLE_SOURCE_LOCATION)
  1430. #endif // !defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
  1431. // Boost support for source_location and system errors.
  1432. #if !defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  1433. # if !defined(BOOST_ASIO_DISABLE_BOOST_SOURCE_LOCATION)
  1434. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 107900)
  1435. # define BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION 1
  1436. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 107900)
  1437. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_SOURCE_LOCATION)
  1438. #endif // !defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  1439. // Helper macros for working with Boost source locations.
  1440. #if defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  1441. # define BOOST_ASIO_SOURCE_LOCATION_PARAM \
  1442. , const boost::source_location& loc
  1443. # define BOOST_ASIO_SOURCE_LOCATION_DEFAULTED_PARAM \
  1444. , const boost::source_location& loc = BOOST_CURRENT_LOCATION
  1445. # define BOOST_ASIO_SOURCE_LOCATION_ARG , loc
  1446. #else // if defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  1447. # define BOOST_ASIO_SOURCE_LOCATION_PARAM
  1448. # define BOOST_ASIO_SOURCE_LOCATION_DEFAULTED_PARAM
  1449. # define BOOST_ASIO_SOURCE_LOCATION_ARG
  1450. #endif // if defined(BOOST_ASIO_HAS_BOOST_SOURCE_LOCATION)
  1451. // Standard library support for std::index_sequence.
  1452. #if !defined(BOOST_ASIO_HAS_STD_INDEX_SEQUENCE)
  1453. # if !defined(BOOST_ASIO_DISABLE_STD_INDEX_SEQUENCE)
  1454. # if defined(__clang__)
  1455. # if (__cplusplus >= 201402)
  1456. # define BOOST_ASIO_HAS_STD_INDEX_SEQUENCE 1
  1457. # endif // (__cplusplus >= 201402)
  1458. # elif defined(__GNUC__)
  1459. # if (__GNUC__ >= 7)
  1460. # if (__cplusplus >= 201402)
  1461. # define BOOST_ASIO_HAS_STD_INDEX_SEQUENCE 1
  1462. # endif // (__cplusplus >= 201402)
  1463. # endif // (__GNUC__ >= 7)
  1464. # endif // defined(__GNUC__)
  1465. # if defined(BOOST_ASIO_MSVC)
  1466. # if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201402)
  1467. # define BOOST_ASIO_HAS_STD_INDEX_SEQUENCE 1
  1468. # endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201402)
  1469. # endif // defined(BOOST_ASIO_MSVC)
  1470. # endif // !defined(BOOST_ASIO_DISABLE_STD_INDEX_SEQUENCE)
  1471. #endif // !defined(BOOST_ASIO_HAS_STD_INDEX_SEQUENCE)
  1472. // Windows App target. Windows but with a limited API.
  1473. #if !defined(BOOST_ASIO_WINDOWS_APP)
  1474. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
  1475. # include <winapifamily.h>
  1476. # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
  1477. || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)) \
  1478. && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  1479. # define BOOST_ASIO_WINDOWS_APP 1
  1480. # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  1481. // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  1482. # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
  1483. #endif // !defined(BOOST_ASIO_WINDOWS_APP)
  1484. // Legacy WinRT target. Windows App is preferred.
  1485. #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1486. # if !defined(BOOST_ASIO_WINDOWS_APP)
  1487. # if defined(__cplusplus_winrt)
  1488. # include <winapifamily.h>
  1489. # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
  1490. && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  1491. # define BOOST_ASIO_WINDOWS_RUNTIME 1
  1492. # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  1493. // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  1494. # endif // defined(__cplusplus_winrt)
  1495. # endif // !defined(BOOST_ASIO_WINDOWS_APP)
  1496. #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1497. // Windows target. Excludes WinRT but includes Windows App targets.
  1498. #if !defined(BOOST_ASIO_WINDOWS)
  1499. # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1500. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
  1501. # define BOOST_ASIO_WINDOWS 1
  1502. # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  1503. # define BOOST_ASIO_WINDOWS 1
  1504. # elif defined(BOOST_ASIO_WINDOWS_APP)
  1505. # define BOOST_ASIO_WINDOWS 1
  1506. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
  1507. # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1508. #endif // !defined(BOOST_ASIO_WINDOWS)
  1509. // Windows: target OS version.
  1510. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1511. # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
  1512. # if defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
  1513. # pragma message( \
  1514. "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
  1515. "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\
  1516. "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\
  1517. "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).")
  1518. # else // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
  1519. # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
  1520. # warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line.
  1521. # warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
  1522. # endif // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
  1523. # define _WIN32_WINNT 0x0601
  1524. # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
  1525. # if defined(_MSC_VER)
  1526. # if defined(_WIN32) && !defined(WIN32)
  1527. # if !defined(_WINSOCK2API_)
  1528. # define WIN32 // Needed for correct types in winsock2.h
  1529. # else // !defined(_WINSOCK2API_)
  1530. # error Please define the macro WIN32 in your compiler options
  1531. # endif // !defined(_WINSOCK2API_)
  1532. # endif // defined(_WIN32) && !defined(WIN32)
  1533. # endif // defined(_MSC_VER)
  1534. # if defined(__BORLANDC__)
  1535. # if defined(__WIN32__) && !defined(WIN32)
  1536. # if !defined(_WINSOCK2API_)
  1537. # define WIN32 // Needed for correct types in winsock2.h
  1538. # else // !defined(_WINSOCK2API_)
  1539. # error Please define the macro WIN32 in your compiler options
  1540. # endif // !defined(_WINSOCK2API_)
  1541. # endif // defined(__WIN32__) && !defined(WIN32)
  1542. # endif // defined(__BORLANDC__)
  1543. # if defined(__CYGWIN__)
  1544. # if !defined(__USE_W32_SOCKETS)
  1545. # error You must add -D__USE_W32_SOCKETS to your compiler options.
  1546. # endif // !defined(__USE_W32_SOCKETS)
  1547. # endif // defined(__CYGWIN__)
  1548. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1549. // Windows: minimise header inclusion.
  1550. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1551. # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
  1552. # if !defined(WIN32_LEAN_AND_MEAN)
  1553. # define WIN32_LEAN_AND_MEAN
  1554. # endif // !defined(WIN32_LEAN_AND_MEAN)
  1555. # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
  1556. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1557. // Windows: suppress definition of "min" and "max" macros.
  1558. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1559. # if !defined(BOOST_ASIO_NO_NOMINMAX)
  1560. # if !defined(NOMINMAX)
  1561. # define NOMINMAX 1
  1562. # endif // !defined(NOMINMAX)
  1563. # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
  1564. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1565. // Windows: IO Completion Ports.
  1566. #if !defined(BOOST_ASIO_HAS_IOCP)
  1567. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1568. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
  1569. # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  1570. # if !defined(BOOST_ASIO_DISABLE_IOCP)
  1571. # define BOOST_ASIO_HAS_IOCP 1
  1572. # endif // !defined(BOOST_ASIO_DISABLE_IOCP)
  1573. # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  1574. # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
  1575. # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1576. #endif // !defined(BOOST_ASIO_HAS_IOCP)
  1577. // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
  1578. // get access to the various platform feature macros, e.g. to be able to test
  1579. // for threads support.
  1580. #if !defined(BOOST_ASIO_HAS_UNISTD_H)
  1581. # if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  1582. # if defined(unix) \
  1583. || defined(__unix) \
  1584. || defined(_XOPEN_SOURCE) \
  1585. || defined(_POSIX_SOURCE) \
  1586. || (defined(__MACH__) && defined(__APPLE__)) \
  1587. || defined(__FreeBSD__) \
  1588. || defined(__NetBSD__) \
  1589. || defined(__OpenBSD__) \
  1590. || defined(__linux__) \
  1591. || defined(__HAIKU__)
  1592. # define BOOST_ASIO_HAS_UNISTD_H 1
  1593. # endif
  1594. # endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  1595. #endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
  1596. #if defined(BOOST_ASIO_HAS_UNISTD_H)
  1597. # include <unistd.h>
  1598. #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
  1599. // Linux: epoll, eventfd and timerfd.
  1600. #if defined(__linux__)
  1601. # include <linux/version.h>
  1602. # if !defined(BOOST_ASIO_HAS_EPOLL)
  1603. # if !defined(BOOST_ASIO_DISABLE_EPOLL)
  1604. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
  1605. # define BOOST_ASIO_HAS_EPOLL 1
  1606. # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
  1607. # endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
  1608. # endif // !defined(BOOST_ASIO_HAS_EPOLL)
  1609. # if !defined(BOOST_ASIO_HAS_EVENTFD)
  1610. # if !defined(BOOST_ASIO_DISABLE_EVENTFD)
  1611. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  1612. # define BOOST_ASIO_HAS_EVENTFD 1
  1613. # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  1614. # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
  1615. # endif // !defined(BOOST_ASIO_HAS_EVENTFD)
  1616. # if !defined(BOOST_ASIO_HAS_TIMERFD)
  1617. # if defined(BOOST_ASIO_HAS_EPOLL)
  1618. # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
  1619. # define BOOST_ASIO_HAS_TIMERFD 1
  1620. # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
  1621. # endif // defined(BOOST_ASIO_HAS_EPOLL)
  1622. # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
  1623. #endif // defined(__linux__)
  1624. // Linux: io_uring is used instead of epoll.
  1625. #if !defined(BOOST_ASIO_HAS_IO_URING_AS_DEFAULT)
  1626. # if !defined(BOOST_ASIO_HAS_EPOLL) && defined(BOOST_ASIO_HAS_IO_URING)
  1627. # define BOOST_ASIO_HAS_IO_URING_AS_DEFAULT 1
  1628. # endif // !defined(BOOST_ASIO_HAS_EPOLL) && defined(BOOST_ASIO_HAS_IO_URING)
  1629. #endif // !defined(BOOST_ASIO_HAS_IO_URING_AS_DEFAULT)
  1630. // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
  1631. #if (defined(__MACH__) && defined(__APPLE__)) \
  1632. || defined(__FreeBSD__) \
  1633. || defined(__NetBSD__) \
  1634. || defined(__OpenBSD__)
  1635. # if !defined(BOOST_ASIO_HAS_KQUEUE)
  1636. # if !defined(BOOST_ASIO_DISABLE_KQUEUE)
  1637. # define BOOST_ASIO_HAS_KQUEUE 1
  1638. # endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
  1639. # endif // !defined(BOOST_ASIO_HAS_KQUEUE)
  1640. #endif // (defined(__MACH__) && defined(__APPLE__))
  1641. // || defined(__FreeBSD__)
  1642. // || defined(__NetBSD__)
  1643. // || defined(__OpenBSD__)
  1644. // Solaris: /dev/poll.
  1645. #if defined(__sun)
  1646. # if !defined(BOOST_ASIO_HAS_DEV_POLL)
  1647. # if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
  1648. # define BOOST_ASIO_HAS_DEV_POLL 1
  1649. # endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
  1650. # endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
  1651. #endif // defined(__sun)
  1652. // Serial ports.
  1653. #if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
  1654. # if defined(BOOST_ASIO_HAS_IOCP) \
  1655. || !defined(BOOST_ASIO_WINDOWS) \
  1656. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1657. && !defined(__CYGWIN__)
  1658. # if !defined(__SYMBIAN32__)
  1659. # if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
  1660. # define BOOST_ASIO_HAS_SERIAL_PORT 1
  1661. # endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
  1662. # endif // !defined(__SYMBIAN32__)
  1663. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1664. // || !defined(BOOST_ASIO_WINDOWS)
  1665. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1666. // && !defined(__CYGWIN__)
  1667. #endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
  1668. // Windows: stream handles.
  1669. #if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
  1670. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
  1671. # if defined(BOOST_ASIO_HAS_IOCP)
  1672. # define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
  1673. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1674. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
  1675. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
  1676. // Windows: random access handles.
  1677. #if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  1678. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
  1679. # if defined(BOOST_ASIO_HAS_IOCP)
  1680. # define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
  1681. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1682. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
  1683. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  1684. // Windows: object handles.
  1685. #if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
  1686. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
  1687. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1688. # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  1689. # define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
  1690. # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  1691. # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1692. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
  1693. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
  1694. // Windows: OVERLAPPED wrapper.
  1695. #if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
  1696. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
  1697. # if defined(BOOST_ASIO_HAS_IOCP)
  1698. # define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
  1699. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1700. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
  1701. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
  1702. // POSIX: stream-oriented file descriptors.
  1703. #if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
  1704. # if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
  1705. # if !defined(BOOST_ASIO_WINDOWS) \
  1706. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1707. && !defined(__CYGWIN__)
  1708. # define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
  1709. # endif // !defined(BOOST_ASIO_WINDOWS)
  1710. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1711. // && !defined(__CYGWIN__)
  1712. # endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
  1713. #endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
  1714. // UNIX domain sockets.
  1715. #if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
  1716. # if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
  1717. # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1718. # define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
  1719. # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1720. # endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
  1721. #endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
  1722. // Files.
  1723. #if !defined(BOOST_ASIO_HAS_FILE)
  1724. # if !defined(BOOST_ASIO_DISABLE_FILE)
  1725. # if defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  1726. # define BOOST_ASIO_HAS_FILE 1
  1727. # elif defined(BOOST_ASIO_HAS_IO_URING)
  1728. # define BOOST_ASIO_HAS_FILE 1
  1729. # endif // defined(BOOST_ASIO_HAS_IO_URING)
  1730. # endif // !defined(BOOST_ASIO_DISABLE_FILE)
  1731. #endif // !defined(BOOST_ASIO_HAS_FILE)
  1732. // Pipes.
  1733. #if !defined(BOOST_ASIO_HAS_PIPE)
  1734. # if defined(BOOST_ASIO_HAS_IOCP) \
  1735. || !defined(BOOST_ASIO_WINDOWS) \
  1736. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1737. && !defined(__CYGWIN__)
  1738. # if !defined(__SYMBIAN32__)
  1739. # if !defined(BOOST_ASIO_DISABLE_PIPE)
  1740. # define BOOST_ASIO_HAS_PIPE 1
  1741. # endif // !defined(BOOST_ASIO_DISABLE_PIPE)
  1742. # endif // !defined(__SYMBIAN32__)
  1743. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1744. // || !defined(BOOST_ASIO_WINDOWS)
  1745. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1746. // && !defined(__CYGWIN__)
  1747. #endif // !defined(BOOST_ASIO_HAS_PIPE)
  1748. // Can use sigaction() instead of signal().
  1749. #if !defined(BOOST_ASIO_HAS_SIGACTION)
  1750. # if !defined(BOOST_ASIO_DISABLE_SIGACTION)
  1751. # if !defined(BOOST_ASIO_WINDOWS) \
  1752. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1753. && !defined(__CYGWIN__)
  1754. # define BOOST_ASIO_HAS_SIGACTION 1
  1755. # endif // !defined(BOOST_ASIO_WINDOWS)
  1756. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1757. // && !defined(__CYGWIN__)
  1758. # endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
  1759. #endif // !defined(BOOST_ASIO_HAS_SIGACTION)
  1760. // Can use signal().
  1761. #if !defined(BOOST_ASIO_HAS_SIGNAL)
  1762. # if !defined(BOOST_ASIO_DISABLE_SIGNAL)
  1763. # if !defined(UNDER_CE)
  1764. # define BOOST_ASIO_HAS_SIGNAL 1
  1765. # endif // !defined(UNDER_CE)
  1766. # endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
  1767. #endif // !defined(BOOST_ASIO_HAS_SIGNAL)
  1768. // Can use getaddrinfo() and getnameinfo().
  1769. #if !defined(BOOST_ASIO_HAS_GETADDRINFO)
  1770. # if !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
  1771. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1772. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
  1773. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1774. # elif defined(UNDER_CE)
  1775. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1776. # endif // defined(UNDER_CE)
  1777. # elif defined(__MACH__) && defined(__APPLE__)
  1778. # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  1779. # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
  1780. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1781. # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
  1782. # else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  1783. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1784. # endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  1785. # else // defined(__MACH__) && defined(__APPLE__)
  1786. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1787. # endif // defined(__MACH__) && defined(__APPLE__)
  1788. # endif // !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
  1789. #endif // !defined(BOOST_ASIO_HAS_GETADDRINFO)
  1790. // Whether standard iostreams are disabled.
  1791. #if !defined(BOOST_ASIO_NO_IOSTREAM)
  1792. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
  1793. # define BOOST_ASIO_NO_IOSTREAM 1
  1794. # endif // !defined(BOOST_NO_IOSTREAM)
  1795. #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
  1796. // Whether exception handling is disabled.
  1797. #if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  1798. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
  1799. # define BOOST_ASIO_NO_EXCEPTIONS 1
  1800. # endif // !defined(BOOST_NO_EXCEPTIONS)
  1801. #endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  1802. // Whether the typeid operator is supported.
  1803. #if !defined(BOOST_ASIO_NO_TYPEID)
  1804. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
  1805. # define BOOST_ASIO_NO_TYPEID 1
  1806. # endif // !defined(BOOST_NO_TYPEID)
  1807. #endif // !defined(BOOST_ASIO_NO_TYPEID)
  1808. // Threads.
  1809. #if !defined(BOOST_ASIO_HAS_THREADS)
  1810. # if !defined(BOOST_ASIO_DISABLE_THREADS)
  1811. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
  1812. # define BOOST_ASIO_HAS_THREADS 1
  1813. # elif defined(__GNUC__) && !defined(__MINGW32__) \
  1814. && !defined(linux) && !defined(__linux) && !defined(__linux__)
  1815. # define BOOST_ASIO_HAS_THREADS 1
  1816. # elif defined(_MT) || defined(__MT__)
  1817. # define BOOST_ASIO_HAS_THREADS 1
  1818. # elif defined(_REENTRANT)
  1819. # define BOOST_ASIO_HAS_THREADS 1
  1820. # elif defined(__APPLE__)
  1821. # define BOOST_ASIO_HAS_THREADS 1
  1822. # elif defined(__HAIKU__)
  1823. # define BOOST_ASIO_HAS_THREADS 1
  1824. # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
  1825. # define BOOST_ASIO_HAS_THREADS 1
  1826. # elif defined(_PTHREADS)
  1827. # define BOOST_ASIO_HAS_THREADS 1
  1828. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
  1829. # endif // !defined(BOOST_ASIO_DISABLE_THREADS)
  1830. #endif // !defined(BOOST_ASIO_HAS_THREADS)
  1831. // POSIX threads.
  1832. #if !defined(BOOST_ASIO_HAS_PTHREADS)
  1833. # if defined(BOOST_ASIO_HAS_THREADS)
  1834. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
  1835. # define BOOST_ASIO_HAS_PTHREADS 1
  1836. # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
  1837. # define BOOST_ASIO_HAS_PTHREADS 1
  1838. # elif defined(__HAIKU__)
  1839. # define BOOST_ASIO_HAS_PTHREADS 1
  1840. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
  1841. # endif // defined(BOOST_ASIO_HAS_THREADS)
  1842. #endif // !defined(BOOST_ASIO_HAS_PTHREADS)
  1843. // Helper to prevent macro expansion.
  1844. #define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
  1845. // Helper to define in-class constants.
  1846. #if !defined(BOOST_ASIO_STATIC_CONSTANT)
  1847. # if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1848. # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
  1849. BOOST_STATIC_CONSTANT(type, assignment)
  1850. # else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1851. # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
  1852. static const type assignment
  1853. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1854. #endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
  1855. // Boost align library.
  1856. #if !defined(BOOST_ASIO_HAS_BOOST_ALIGN)
  1857. # if !defined(BOOST_ASIO_DISABLE_BOOST_ALIGN)
  1858. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105600)
  1859. # define BOOST_ASIO_HAS_BOOST_ALIGN 1
  1860. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105600)
  1861. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ALIGN)
  1862. #endif // !defined(BOOST_ASIO_HAS_BOOST_ALIGN)
  1863. // Boost array library.
  1864. #if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
  1865. # if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
  1866. # define BOOST_ASIO_HAS_BOOST_ARRAY 1
  1867. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
  1868. #endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
  1869. // Boost assert macro.
  1870. #if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
  1871. # if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
  1872. # define BOOST_ASIO_HAS_BOOST_ASSERT 1
  1873. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
  1874. #endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
  1875. // Boost limits header.
  1876. #if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
  1877. # if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
  1878. # define BOOST_ASIO_HAS_BOOST_LIMITS 1
  1879. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
  1880. #endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
  1881. // Boost throw_exception function.
  1882. #if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
  1883. # if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
  1884. # define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
  1885. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
  1886. #endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
  1887. // Boost regex library.
  1888. #if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
  1889. # if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
  1890. # define BOOST_ASIO_HAS_BOOST_REGEX 1
  1891. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
  1892. #endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
  1893. // Boost bind function.
  1894. #if !defined(BOOST_ASIO_HAS_BOOST_BIND)
  1895. # if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
  1896. # define BOOST_ASIO_HAS_BOOST_BIND 1
  1897. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
  1898. #endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
  1899. // Boost's BOOST_WORKAROUND macro.
  1900. #if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
  1901. # if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
  1902. # define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
  1903. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
  1904. #endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
  1905. // Microsoft Visual C++'s secure C runtime library.
  1906. #if !defined(BOOST_ASIO_HAS_SECURE_RTL)
  1907. # if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
  1908. # if defined(BOOST_ASIO_MSVC) \
  1909. && (BOOST_ASIO_MSVC >= 1400) \
  1910. && !defined(UNDER_CE)
  1911. # define BOOST_ASIO_HAS_SECURE_RTL 1
  1912. # endif // defined(BOOST_ASIO_MSVC)
  1913. // && (BOOST_ASIO_MSVC >= 1400)
  1914. // && !defined(UNDER_CE)
  1915. # endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
  1916. #endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
  1917. // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
  1918. #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
  1919. # if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
  1920. # if defined(__GNUC__)
  1921. # if (__GNUC__ >= 3)
  1922. # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
  1923. # endif // (__GNUC__ >= 3)
  1924. # elif !defined(__BORLANDC__) || defined(__clang__)
  1925. # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
  1926. # endif // !defined(__BORLANDC__) || defined(__clang__)
  1927. # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
  1928. #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
  1929. // Support for the __thread keyword extension.
  1930. #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
  1931. # if defined(__linux__)
  1932. # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  1933. # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
  1934. # if !defined(__INTEL_COMPILER) && !defined(__ICL) \
  1935. && !(defined(__clang__) && defined(__ANDROID__))
  1936. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1937. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1938. # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
  1939. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1940. # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
  1941. // && !(defined(__clang__) && defined(__ANDROID__))
  1942. # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
  1943. # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  1944. # endif // defined(__linux__)
  1945. # if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1946. # if (_MSC_VER >= 1700)
  1947. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1948. # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
  1949. # endif // (_MSC_VER >= 1700)
  1950. # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1951. #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
  1952. #if !defined(BOOST_ASIO_THREAD_KEYWORD)
  1953. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1954. #endif // !defined(BOOST_ASIO_THREAD_KEYWORD)
  1955. // Support for POSIX ssize_t typedef.
  1956. #if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
  1957. # if defined(__linux__) \
  1958. || (defined(__MACH__) && defined(__APPLE__))
  1959. # define BOOST_ASIO_HAS_SSIZE_T 1
  1960. # endif // defined(__linux__)
  1961. // || (defined(__MACH__) && defined(__APPLE__))
  1962. #endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
  1963. // Helper macros to manage transition away from error_code return values.
  1964. #if defined(BOOST_ASIO_NO_DEPRECATED)
  1965. # define BOOST_ASIO_SYNC_OP_VOID void
  1966. # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return
  1967. #else // defined(BOOST_ASIO_NO_DEPRECATED)
  1968. # define BOOST_ASIO_SYNC_OP_VOID boost::system::error_code
  1969. # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return e
  1970. #endif // defined(BOOST_ASIO_NO_DEPRECATED)
  1971. // Newer gcc, clang need special treatment to suppress unused typedef warnings.
  1972. #if defined(__clang__)
  1973. # if defined(__apple_build_version__)
  1974. # if (__clang_major__ >= 7)
  1975. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1976. # endif // (__clang_major__ >= 7)
  1977. # elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \
  1978. || (__clang_major__ > 3)
  1979. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1980. # endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6))
  1981. // || (__clang_major__ > 3)
  1982. #elif defined(__GNUC__)
  1983. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1984. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1985. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1986. #endif // defined(__GNUC__)
  1987. #if !defined(BOOST_ASIO_UNUSED_TYPEDEF)
  1988. # define BOOST_ASIO_UNUSED_TYPEDEF
  1989. #endif // !defined(BOOST_ASIO_UNUSED_TYPEDEF)
  1990. // Some versions of gcc generate spurious warnings about unused variables.
  1991. #if defined(__GNUC__)
  1992. # if (__GNUC__ >= 4)
  1993. # define BOOST_ASIO_UNUSED_VARIABLE __attribute__((__unused__))
  1994. # endif // (__GNUC__ >= 4)
  1995. #endif // defined(__GNUC__)
  1996. #if !defined(BOOST_ASIO_UNUSED_VARIABLE)
  1997. # define BOOST_ASIO_UNUSED_VARIABLE
  1998. #endif // !defined(BOOST_ASIO_UNUSED_VARIABLE)
  1999. // Helper macro to tell the optimiser what may be assumed to be true.
  2000. #if defined(BOOST_ASIO_MSVC)
  2001. # define BOOST_ASIO_ASSUME(expr) __assume(expr)
  2002. #elif defined(__clang__)
  2003. # if __has_builtin(__builtin_assume)
  2004. # define BOOST_ASIO_ASSUME(expr) __builtin_assume(expr)
  2005. # endif // __has_builtin(__builtin_assume)
  2006. #elif defined(__GNUC__)
  2007. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  2008. # define BOOST_ASIO_ASSUME(expr) if (expr) {} else { __builtin_unreachable(); }
  2009. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  2010. #endif // defined(__GNUC__)
  2011. #if !defined(BOOST_ASIO_ASSUME)
  2012. # define BOOST_ASIO_ASSUME(expr) (void)0
  2013. #endif // !defined(BOOST_ASIO_ASSUME)
  2014. // Support the co_await keyword on compilers known to allow it.
  2015. #if !defined(BOOST_ASIO_HAS_CO_AWAIT)
  2016. # if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
  2017. # if defined(BOOST_ASIO_MSVC)
  2018. # if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) && !defined(__clang__)
  2019. # define BOOST_ASIO_HAS_CO_AWAIT 1
  2020. # elif (_MSC_FULL_VER >= 190023506)
  2021. # if defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
  2022. # define BOOST_ASIO_HAS_CO_AWAIT 1
  2023. # endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
  2024. # endif // (_MSC_FULL_VER >= 190023506)
  2025. # elif defined(__clang__)
  2026. # if (__clang_major__ >= 14)
  2027. # if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
  2028. # if __has_include(<coroutine>)
  2029. # define BOOST_ASIO_HAS_CO_AWAIT 1
  2030. # endif // __has_include(<coroutine>)
  2031. # elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  2032. # if __has_include(<experimental/coroutine>)
  2033. # define BOOST_ASIO_HAS_CO_AWAIT 1
  2034. # endif // __has_include(<experimental/coroutine>)
  2035. # endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  2036. # else // (__clang_major__ >= 14)
  2037. # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  2038. # if __has_include(<experimental/coroutine>)
  2039. # define BOOST_ASIO_HAS_CO_AWAIT 1
  2040. # endif // __has_include(<experimental/coroutine>)
  2041. # endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  2042. # endif // (__clang_major__ >= 14)
  2043. # elif defined(__GNUC__)
  2044. # if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  2045. # if __has_include(<coroutine>)
  2046. # define BOOST_ASIO_HAS_CO_AWAIT 1
  2047. # endif // __has_include(<coroutine>)
  2048. # endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  2049. # endif // defined(__GNUC__)
  2050. # endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
  2051. #endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
  2052. // Standard library support for coroutines.
  2053. #if !defined(BOOST_ASIO_HAS_STD_COROUTINE)
  2054. # if !defined(BOOST_ASIO_DISABLE_STD_COROUTINE)
  2055. # if defined(BOOST_ASIO_MSVC)
  2056. # if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
  2057. # define BOOST_ASIO_HAS_STD_COROUTINE 1
  2058. # endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
  2059. # elif defined(__clang__)
  2060. # if (__clang_major__ >= 14)
  2061. # if (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
  2062. # if __has_include(<coroutine>)
  2063. # define BOOST_ASIO_HAS_STD_COROUTINE 1
  2064. # endif // __has_include(<coroutine>)
  2065. # endif // (__cplusplus >= 202002) && (__cpp_impl_coroutine >= 201902)
  2066. # endif // (__clang_major__ >= 14)
  2067. # elif defined(__GNUC__)
  2068. # if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  2069. # if __has_include(<coroutine>)
  2070. # define BOOST_ASIO_HAS_STD_COROUTINE 1
  2071. # endif // __has_include(<coroutine>)
  2072. # endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
  2073. # endif // defined(__GNUC__)
  2074. # endif // !defined(BOOST_ASIO_DISABLE_STD_COROUTINE)
  2075. #endif // !defined(BOOST_ASIO_HAS_STD_COROUTINE)
  2076. // Compiler support for the the [[nodiscard]] attribute.
  2077. #if !defined(BOOST_ASIO_NODISCARD)
  2078. # if defined(__has_cpp_attribute)
  2079. # if __has_cpp_attribute(nodiscard)
  2080. # if (__cplusplus >= 201703)
  2081. # define BOOST_ASIO_NODISCARD [[nodiscard]]
  2082. # endif // (__cplusplus >= 201703)
  2083. # endif // __has_cpp_attribute(nodiscard)
  2084. # endif // defined(__has_cpp_attribute)
  2085. #endif // !defined(BOOST_ASIO_NODISCARD)
  2086. #if !defined(BOOST_ASIO_NODISCARD)
  2087. # define BOOST_ASIO_NODISCARD
  2088. #endif // !defined(BOOST_ASIO_NODISCARD)
  2089. // Kernel support for MSG_NOSIGNAL.
  2090. #if !defined(BOOST_ASIO_HAS_MSG_NOSIGNAL)
  2091. # if defined(__linux__)
  2092. # define BOOST_ASIO_HAS_MSG_NOSIGNAL 1
  2093. # elif defined(_POSIX_VERSION)
  2094. # if (_POSIX_VERSION >= 200809L)
  2095. # define BOOST_ASIO_HAS_MSG_NOSIGNAL 1
  2096. # endif // _POSIX_VERSION >= 200809L
  2097. # endif // defined(_POSIX_VERSION)
  2098. #endif // !defined(BOOST_ASIO_HAS_MSG_NOSIGNAL)
  2099. // Standard library support for std::hash.
  2100. #if !defined(BOOST_ASIO_HAS_STD_HASH)
  2101. # if !defined(BOOST_ASIO_DISABLE_STD_HASH)
  2102. # if defined(__clang__)
  2103. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  2104. # define BOOST_ASIO_HAS_STD_HASH 1
  2105. # elif (__cplusplus >= 201103)
  2106. # define BOOST_ASIO_HAS_STD_HASH 1
  2107. # endif // (__cplusplus >= 201103)
  2108. # elif defined(__GNUC__)
  2109. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  2110. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  2111. # define BOOST_ASIO_HAS_STD_HASH 1
  2112. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  2113. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  2114. # endif // defined(__GNUC__)
  2115. # if defined(BOOST_ASIO_MSVC)
  2116. # if (_MSC_VER >= 1700)
  2117. # define BOOST_ASIO_HAS_STD_HASH 1
  2118. # endif // (_MSC_VER >= 1700)
  2119. # endif // defined(BOOST_ASIO_MSVC)
  2120. # endif // !defined(BOOST_ASIO_DISABLE_STD_HASH)
  2121. #endif // !defined(BOOST_ASIO_HAS_STD_HASH)
  2122. // Standard library support for std::to_address.
  2123. #if !defined(BOOST_ASIO_HAS_STD_TO_ADDRESS)
  2124. # if !defined(BOOST_ASIO_DISABLE_STD_TO_ADDRESS)
  2125. # if defined(__clang__)
  2126. # if (__cplusplus >= 202002)
  2127. # define BOOST_ASIO_HAS_STD_TO_ADDRESS 1
  2128. # endif // (__cplusplus >= 202002)
  2129. # elif defined(__GNUC__)
  2130. # if (__GNUC__ >= 8)
  2131. # if (__cplusplus >= 202002)
  2132. # define BOOST_ASIO_HAS_STD_TO_ADDRESS 1
  2133. # endif // (__cplusplus >= 202002)
  2134. # endif // (__GNUC__ >= 8)
  2135. # endif // defined(__GNUC__)
  2136. # if defined(BOOST_ASIO_MSVC)
  2137. # if (_MSC_VER >= 1922) && (_MSVC_LANG >= 202002)
  2138. # define BOOST_ASIO_HAS_STD_TO_ADDRESS 1
  2139. # endif // (_MSC_VER >= 1922) && (_MSVC_LANG >= 202002)
  2140. # endif // defined(BOOST_ASIO_MSVC)
  2141. # endif // !defined(BOOST_ASIO_DISABLE_STD_TO_ADDRESS)
  2142. #endif // !defined(BOOST_ASIO_HAS_STD_TO_ADDRESS)
  2143. // Standard library support for snprintf.
  2144. #if !defined(BOOST_ASIO_HAS_SNPRINTF)
  2145. # if !defined(BOOST_ASIO_DISABLE_SNPRINTF)
  2146. # if defined(__apple_build_version__)
  2147. # if (__clang_major__ >= 14)
  2148. # define BOOST_ASIO_HAS_SNPRINTF 1
  2149. # endif // (__clang_major__ >= 14)
  2150. # endif // defined(__apple_build_version__)
  2151. # endif // !defined(BOOST_ASIO_DISABLE_SNPRINTF)
  2152. #endif // !defined(BOOST_ASIO_HAS_SNPRINTF)
  2153. #endif // BOOST_ASIO_DETAIL_CONFIG_HPP