config.hpp 83 KB

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