config.hpp 77 KB

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