config.hpp 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483
  1. //
  2. // detail/config.hpp
  3. // ~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2020 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. // Microsoft Visual C++ detection.
  59. #if !defined(BOOST_ASIO_MSVC)
  60. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
  61. # define BOOST_ASIO_MSVC BOOST_MSVC
  62. # elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \
  63. || (!defined(__MWERKS__) && !defined(__EDG_VERSION__)))
  64. # define BOOST_ASIO_MSVC _MSC_VER
  65. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
  66. #endif // !defined(BOOST_ASIO_MSVC)
  67. // Clang / libc++ detection.
  68. #if defined(__clang__)
  69. # if (__cplusplus >= 201103)
  70. # if __has_include(<__config>)
  71. # include <__config>
  72. # if defined(_LIBCPP_VERSION)
  73. # define BOOST_ASIO_HAS_CLANG_LIBCXX 1
  74. # endif // defined(_LIBCPP_VERSION)
  75. # endif // __has_include(<__config>)
  76. # endif // (__cplusplus >= 201103)
  77. #endif // defined(__clang__)
  78. // Android platform detection.
  79. #if defined(__ANDROID__)
  80. # include <android/api-level.h>
  81. #endif // defined(__ANDROID__)
  82. // Support move construction and assignment on compilers known to allow it.
  83. #if !defined(BOOST_ASIO_HAS_MOVE)
  84. # if !defined(BOOST_ASIO_DISABLE_MOVE)
  85. # if defined(__clang__)
  86. # if __has_feature(__cxx_rvalue_references__)
  87. # define BOOST_ASIO_HAS_MOVE 1
  88. # endif // __has_feature(__cxx_rvalue_references__)
  89. # endif // defined(__clang__)
  90. # if defined(__GNUC__)
  91. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  92. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  93. # define BOOST_ASIO_HAS_MOVE 1
  94. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  95. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  96. # endif // defined(__GNUC__)
  97. # if defined(BOOST_ASIO_MSVC)
  98. # if (_MSC_VER >= 1700)
  99. # define BOOST_ASIO_HAS_MOVE 1
  100. # endif // (_MSC_VER >= 1700)
  101. # endif // defined(BOOST_ASIO_MSVC)
  102. # if defined(__INTEL_CXX11_MODE__)
  103. # if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
  104. # define BOOST_ASIO_HAS_MOVE 1
  105. # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
  106. # if defined(__ICL) && (__ICL >= 1500)
  107. # define BOOST_ASIO_HAS_MOVE 1
  108. # endif // defined(__ICL) && (__ICL >= 1500)
  109. # endif // defined(__INTEL_CXX11_MODE__)
  110. # endif // !defined(BOOST_ASIO_DISABLE_MOVE)
  111. #endif // !defined(BOOST_ASIO_HAS_MOVE)
  112. // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
  113. // * BOOST_ASIO_MOVE_ARG,
  114. // * BOOST_ASIO_NONDEDUCED_MOVE_ARG, and
  115. // * BOOST_ASIO_MOVE_CAST
  116. // to take advantage of rvalue references and perfect forwarding.
  117. #if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
  118. # define BOOST_ASIO_MOVE_ARG(type) type&&
  119. # define BOOST_ASIO_MOVE_ARG2(type1, type2) type1, type2&&
  120. # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) type&
  121. # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
  122. # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
  123. #endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
  124. // If BOOST_ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
  125. // implementation. Note that older g++ and MSVC versions don't like it when you
  126. // pass a non-member function through a const reference, so for most compilers
  127. // we'll play it safe and stick with the old approach of passing the handler by
  128. // value.
  129. #if !defined(BOOST_ASIO_MOVE_CAST)
  130. # if defined(__GNUC__)
  131. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
  132. # define BOOST_ASIO_MOVE_ARG(type) const type&
  133. # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
  134. # define BOOST_ASIO_MOVE_ARG(type) type
  135. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
  136. # elif defined(BOOST_ASIO_MSVC)
  137. # if (_MSC_VER >= 1400)
  138. # define BOOST_ASIO_MOVE_ARG(type) const type&
  139. # else // (_MSC_VER >= 1400)
  140. # define BOOST_ASIO_MOVE_ARG(type) type
  141. # endif // (_MSC_VER >= 1400)
  142. # else
  143. # define BOOST_ASIO_MOVE_ARG(type) type
  144. # endif
  145. # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) const type&
  146. # define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
  147. # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
  148. #endif // !defined(BOOST_ASIO_MOVE_CAST)
  149. // Support variadic templates on compilers known to allow it.
  150. #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  151. # if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
  152. # if defined(__clang__)
  153. # if __has_feature(__cxx_variadic_templates__)
  154. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  155. # endif // __has_feature(__cxx_variadic_templates__)
  156. # endif // defined(__clang__)
  157. # if defined(__GNUC__)
  158. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  159. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  160. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  161. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  162. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  163. # endif // defined(__GNUC__)
  164. # if defined(BOOST_ASIO_MSVC)
  165. # if (_MSC_VER >= 1900)
  166. # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
  167. # endif // (_MSC_VER >= 1900)
  168. # endif // defined(BOOST_ASIO_MSVC)
  169. # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
  170. #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  171. // Support deleted functions on compilers known to allow it.
  172. #if !defined(BOOST_ASIO_DELETED)
  173. # if defined(__GNUC__)
  174. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  175. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  176. # define BOOST_ASIO_DELETED = delete
  177. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  178. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  179. # endif // defined(__GNUC__)
  180. # if defined(__clang__)
  181. # if __has_feature(__cxx_deleted_functions__)
  182. # define BOOST_ASIO_DELETED = delete
  183. # endif // __has_feature(__cxx_deleted_functions__)
  184. # endif // defined(__clang__)
  185. # if defined(BOOST_ASIO_MSVC)
  186. # if (_MSC_VER >= 1900)
  187. # define BOOST_ASIO_DELETED = delete
  188. # endif // (_MSC_VER >= 1900)
  189. # endif // defined(BOOST_ASIO_MSVC)
  190. # if !defined(BOOST_ASIO_DELETED)
  191. # define BOOST_ASIO_DELETED
  192. # endif // !defined(BOOST_ASIO_DELETED)
  193. #endif // !defined(BOOST_ASIO_DELETED)
  194. // Support constexpr on compilers known to allow it.
  195. #if !defined(BOOST_ASIO_HAS_CONSTEXPR)
  196. # if !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
  197. # if defined(__clang__)
  198. # if __has_feature(__cxx_constexpr__)
  199. # define BOOST_ASIO_HAS_CONSTEXPR 1
  200. # endif // __has_feature(__cxx_constexr__)
  201. # endif // defined(__clang__)
  202. # if defined(__GNUC__)
  203. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  204. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  205. # define BOOST_ASIO_HAS_CONSTEXPR 1
  206. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  207. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  208. # endif // defined(__GNUC__)
  209. # if defined(BOOST_ASIO_MSVC)
  210. # if (_MSC_VER >= 1900)
  211. # define BOOST_ASIO_HAS_CONSTEXPR 1
  212. # endif // (_MSC_VER >= 1900)
  213. # endif // defined(BOOST_ASIO_MSVC)
  214. # endif // !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
  215. #endif // !defined(BOOST_ASIO_HAS_CONSTEXPR)
  216. #if !defined(BOOST_ASIO_CONSTEXPR)
  217. # if defined(BOOST_ASIO_HAS_CONSTEXPR)
  218. # define BOOST_ASIO_CONSTEXPR constexpr
  219. # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
  220. # define BOOST_ASIO_CONSTEXPR
  221. # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
  222. #endif // !defined(BOOST_ASIO_CONSTEXPR)
  223. // Support noexcept on compilers known to allow it.
  224. #if !defined(BOOST_ASIO_NOEXCEPT)
  225. # if !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
  226. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
  227. # define BOOST_ASIO_NOEXCEPT BOOST_NOEXCEPT
  228. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW
  229. # elif defined(__clang__)
  230. # if __has_feature(__cxx_noexcept__)
  231. # define BOOST_ASIO_NOEXCEPT noexcept(true)
  232. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
  233. # endif // __has_feature(__cxx_noexcept__)
  234. # elif defined(__GNUC__)
  235. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  236. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  237. # define BOOST_ASIO_NOEXCEPT noexcept(true)
  238. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
  239. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  240. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  241. # elif defined(BOOST_ASIO_MSVC)
  242. # if (_MSC_VER >= 1900)
  243. # define BOOST_ASIO_NOEXCEPT noexcept(true)
  244. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
  245. # endif // (_MSC_VER >= 1900)
  246. # endif // defined(BOOST_ASIO_MSVC)
  247. # endif // !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
  248. # if !defined(BOOST_ASIO_NOEXCEPT)
  249. # define BOOST_ASIO_NOEXCEPT
  250. # endif // !defined(BOOST_ASIO_NOEXCEPT)
  251. # if !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
  252. # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW throw()
  253. # endif // !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
  254. #endif // !defined(BOOST_ASIO_NOEXCEPT)
  255. // Support automatic type deduction on compilers known to support it.
  256. #if !defined(BOOST_ASIO_HAS_DECLTYPE)
  257. # if !defined(BOOST_ASIO_DISABLE_DECLTYPE)
  258. # if defined(__clang__)
  259. # if __has_feature(__cxx_decltype__)
  260. # define BOOST_ASIO_HAS_DECLTYPE 1
  261. # endif // __has_feature(__cxx_decltype__)
  262. # endif // defined(__clang__)
  263. # if defined(__GNUC__)
  264. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  265. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  266. # define BOOST_ASIO_HAS_DECLTYPE 1
  267. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  268. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  269. # endif // defined(__GNUC__)
  270. # if defined(BOOST_ASIO_MSVC)
  271. # if (_MSC_VER >= 1800)
  272. # define BOOST_ASIO_HAS_DECLTYPE 1
  273. # endif // (_MSC_VER >= 1800)
  274. # endif // defined(BOOST_ASIO_MSVC)
  275. # endif // !defined(BOOST_ASIO_DISABLE_DECLTYPE)
  276. #endif // !defined(BOOST_ASIO_HAS_DECLTYPE)
  277. // Support alias templates on compilers known to allow it.
  278. #if !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
  279. # if !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
  280. # if defined(__clang__)
  281. # if __has_feature(__cxx_alias_templates__)
  282. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  283. # endif // __has_feature(__cxx_alias_templates__)
  284. # endif // defined(__clang__)
  285. # if defined(__GNUC__)
  286. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  287. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  288. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  289. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  290. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  291. # endif // defined(__GNUC__)
  292. # if defined(BOOST_ASIO_MSVC)
  293. # if (_MSC_VER >= 1900)
  294. # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
  295. # endif // (_MSC_VER >= 1900)
  296. # endif // defined(BOOST_ASIO_MSVC)
  297. # endif // !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
  298. #endif // !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
  299. // Support return type deduction on compilers known to allow it.
  300. #if !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
  301. # if !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
  302. # if defined(__clang__)
  303. # if __has_feature(__cxx_return_type_deduction__)
  304. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  305. # endif // __has_feature(__cxx_alias_templates__)
  306. # elif (__cplusplus >= 201402)
  307. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  308. # elif defined(__cpp_return_type_deduction)
  309. # if (__cpp_return_type_deduction >= 201304)
  310. # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
  311. # endif // (__cpp_return_type_deduction >= 201304)
  312. # endif // defined(__cpp_return_type_deduction)
  313. # endif // !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
  314. #endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
  315. // Support default function template arguments on compilers known to allow it.
  316. #if !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  317. # if !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  318. # if (__cplusplus >= 201103)
  319. # define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
  320. # endif // (__cplusplus >= 201103)
  321. # endif // !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  322. #endif // !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
  323. // Support concepts on compilers known to allow them.
  324. #if !defined(BOOST_ASIO_HAS_CONCEPTS)
  325. # if !defined(BOOST_ASIO_DISABLE_CONCEPTS)
  326. # if defined(__cpp_concepts)
  327. # define BOOST_ASIO_HAS_CONCEPTS 1
  328. # if (__cpp_concepts >= 201707)
  329. # define BOOST_ASIO_CONCEPT concept
  330. # else // (__cpp_concepts >= 201707)
  331. # define BOOST_ASIO_CONCEPT concept bool
  332. # endif // (__cpp_concepts >= 201707)
  333. # endif // defined(__cpp_concepts)
  334. # endif // !defined(BOOST_ASIO_DISABLE_CONCEPTS)
  335. #endif // !defined(BOOST_ASIO_HAS_CONCEPTS)
  336. // Standard library support for system errors.
  337. # if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
  338. # if defined(__clang__)
  339. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  340. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  341. # elif (__cplusplus >= 201103)
  342. # if __has_include(<system_error>)
  343. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  344. # endif // __has_include(<system_error>)
  345. # endif // (__cplusplus >= 201103)
  346. # endif // defined(__clang__)
  347. # if defined(__GNUC__)
  348. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  349. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  350. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  351. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  352. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  353. # endif // defined(__GNUC__)
  354. # if defined(BOOST_ASIO_MSVC)
  355. # if (_MSC_VER >= 1700)
  356. # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
  357. # endif // (_MSC_VER >= 1700)
  358. # endif // defined(BOOST_ASIO_MSVC)
  359. # endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
  360. // Compliant C++11 compilers put noexcept specifiers on error_category members.
  361. #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  362. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
  363. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
  364. # elif defined(__clang__)
  365. # if __has_feature(__cxx_noexcept__)
  366. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  367. # endif // __has_feature(__cxx_noexcept__)
  368. # elif defined(__GNUC__)
  369. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  370. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  371. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  372. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  373. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  374. # elif defined(BOOST_ASIO_MSVC)
  375. # if (_MSC_VER >= 1900)
  376. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
  377. # endif // (_MSC_VER >= 1900)
  378. # endif // defined(BOOST_ASIO_MSVC)
  379. # if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  380. # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
  381. # endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  382. #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
  383. // Standard library support for arrays.
  384. #if !defined(BOOST_ASIO_HAS_STD_ARRAY)
  385. # if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
  386. # if defined(__clang__)
  387. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  388. # define BOOST_ASIO_HAS_STD_ARRAY 1
  389. # elif (__cplusplus >= 201103)
  390. # if __has_include(<array>)
  391. # define BOOST_ASIO_HAS_STD_ARRAY 1
  392. # endif // __has_include(<array>)
  393. # endif // (__cplusplus >= 201103)
  394. # endif // defined(__clang__)
  395. # if defined(__GNUC__)
  396. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  397. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  398. # define BOOST_ASIO_HAS_STD_ARRAY 1
  399. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  400. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  401. # endif // defined(__GNUC__)
  402. # if defined(BOOST_ASIO_MSVC)
  403. # if (_MSC_VER >= 1600)
  404. # define BOOST_ASIO_HAS_STD_ARRAY 1
  405. # endif // (_MSC_VER >= 1600)
  406. # endif // defined(BOOST_ASIO_MSVC)
  407. # endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
  408. #endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
  409. // Standard library support for shared_ptr and weak_ptr.
  410. #if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
  411. # if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
  412. # if defined(__clang__)
  413. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  414. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  415. # elif (__cplusplus >= 201103)
  416. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  417. # endif // (__cplusplus >= 201103)
  418. # endif // defined(__clang__)
  419. # if defined(__GNUC__)
  420. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  421. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  422. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  423. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  424. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
  425. # endif // defined(__GNUC__)
  426. # if defined(BOOST_ASIO_MSVC)
  427. # if (_MSC_VER >= 1600)
  428. # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
  429. # endif // (_MSC_VER >= 1600)
  430. # endif // defined(BOOST_ASIO_MSVC)
  431. # endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
  432. #endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
  433. // Standard library support for allocator_arg_t.
  434. #if !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
  435. # if !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
  436. # if defined(__clang__)
  437. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  438. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  439. # elif (__cplusplus >= 201103)
  440. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  441. # endif // (__cplusplus >= 201103)
  442. # endif // defined(__clang__)
  443. # if defined(__GNUC__)
  444. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  445. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  446. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  447. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  448. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  449. # endif // defined(__GNUC__)
  450. # if defined(BOOST_ASIO_MSVC)
  451. # if (_MSC_VER >= 1600)
  452. # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
  453. # endif // (_MSC_VER >= 1600)
  454. # endif // defined(BOOST_ASIO_MSVC)
  455. # endif // !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
  456. #endif // !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
  457. // Standard library support for atomic operations.
  458. #if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
  459. # if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
  460. # if defined(__clang__)
  461. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  462. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  463. # elif (__cplusplus >= 201103)
  464. # if __has_include(<atomic>)
  465. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  466. # endif // __has_include(<atomic>)
  467. # elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
  468. # if (__clang_major__ >= 10)
  469. # if __has_include(<atomic>)
  470. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  471. # endif // __has_include(<atomic>)
  472. # endif // (__clang_major__ >= 10)
  473. # endif /// defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
  474. # endif // defined(__clang__)
  475. # if defined(__GNUC__)
  476. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  477. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  478. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  479. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  480. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  481. # endif // defined(__GNUC__)
  482. # if defined(BOOST_ASIO_MSVC)
  483. # if (_MSC_VER >= 1700)
  484. # define BOOST_ASIO_HAS_STD_ATOMIC 1
  485. # endif // (_MSC_VER >= 1700)
  486. # endif // defined(BOOST_ASIO_MSVC)
  487. # endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
  488. #endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
  489. // Standard library support for chrono. Some standard libraries (such as the
  490. // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
  491. // drafts, rather than the eventually standardised name of steady_clock.
  492. #if !defined(BOOST_ASIO_HAS_STD_CHRONO)
  493. # if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
  494. # if defined(__clang__)
  495. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  496. # define BOOST_ASIO_HAS_STD_CHRONO 1
  497. # elif (__cplusplus >= 201103)
  498. # if __has_include(<chrono>)
  499. # define BOOST_ASIO_HAS_STD_CHRONO 1
  500. # endif // __has_include(<chrono>)
  501. # endif // (__cplusplus >= 201103)
  502. # endif // defined(__clang__)
  503. # if defined(__GNUC__)
  504. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  505. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  506. # define BOOST_ASIO_HAS_STD_CHRONO 1
  507. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
  508. # define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
  509. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
  510. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  511. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  512. # endif // defined(__GNUC__)
  513. # if defined(BOOST_ASIO_MSVC)
  514. # if (_MSC_VER >= 1700)
  515. # define BOOST_ASIO_HAS_STD_CHRONO 1
  516. # endif // (_MSC_VER >= 1700)
  517. # endif // defined(BOOST_ASIO_MSVC)
  518. # endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
  519. #endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
  520. // Boost support for chrono.
  521. #if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  522. # if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
  523. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
  524. # define BOOST_ASIO_HAS_BOOST_CHRONO 1
  525. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
  526. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
  527. #endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  528. // Some form of chrono library is available.
  529. #if !defined(BOOST_ASIO_HAS_CHRONO)
  530. # if defined(BOOST_ASIO_HAS_STD_CHRONO) \
  531. || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  532. # define BOOST_ASIO_HAS_CHRONO 1
  533. # endif // defined(BOOST_ASIO_HAS_STD_CHRONO)
  534. // || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
  535. #endif // !defined(BOOST_ASIO_HAS_CHRONO)
  536. // Boost support for the DateTime library.
  537. #if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  538. # if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
  539. # define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
  540. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
  541. #endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  542. // Standard library support for addressof.
  543. #if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
  544. # if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
  545. # if defined(__clang__)
  546. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  547. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  548. # elif (__cplusplus >= 201103)
  549. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  550. # endif // (__cplusplus >= 201103)
  551. # endif // defined(__clang__)
  552. # if defined(__GNUC__)
  553. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  554. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  555. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  556. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  557. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  558. # endif // defined(__GNUC__)
  559. # if defined(BOOST_ASIO_MSVC)
  560. # if (_MSC_VER >= 1700)
  561. # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
  562. # endif // (_MSC_VER >= 1700)
  563. # endif // defined(BOOST_ASIO_MSVC)
  564. # endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
  565. #endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
  566. // Standard library support for the function class.
  567. #if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
  568. # if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
  569. # if defined(__clang__)
  570. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  571. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  572. # elif (__cplusplus >= 201103)
  573. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  574. # endif // (__cplusplus >= 201103)
  575. # endif // defined(__clang__)
  576. # if defined(__GNUC__)
  577. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  578. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  579. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  580. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  581. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  582. # endif // defined(__GNUC__)
  583. # if defined(BOOST_ASIO_MSVC)
  584. # if (_MSC_VER >= 1700)
  585. # define BOOST_ASIO_HAS_STD_FUNCTION 1
  586. # endif // (_MSC_VER >= 1700)
  587. # endif // defined(BOOST_ASIO_MSVC)
  588. # endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
  589. #endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
  590. // Standard library support for type traits.
  591. #if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
  592. # if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
  593. # if defined(__clang__)
  594. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  595. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  596. # elif (__cplusplus >= 201103)
  597. # if __has_include(<type_traits>)
  598. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  599. # endif // __has_include(<type_traits>)
  600. # endif // (__cplusplus >= 201103)
  601. # endif // defined(__clang__)
  602. # if defined(__GNUC__)
  603. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  604. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  605. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  606. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  607. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  608. # endif // defined(__GNUC__)
  609. # if defined(BOOST_ASIO_MSVC)
  610. # if (_MSC_VER >= 1700)
  611. # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
  612. # endif // (_MSC_VER >= 1700)
  613. # endif // defined(BOOST_ASIO_MSVC)
  614. # endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
  615. #endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
  616. // Standard library support for the nullptr_t type.
  617. #if !defined(BOOST_ASIO_HAS_NULLPTR)
  618. # if !defined(BOOST_ASIO_DISABLE_NULLPTR)
  619. # if defined(__clang__)
  620. # if __has_feature(__cxx_nullptr__)
  621. # define BOOST_ASIO_HAS_NULLPTR 1
  622. # endif // __has_feature(__cxx_rvalue_references__)
  623. # elif defined(__GNUC__)
  624. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  625. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  626. # define BOOST_ASIO_HAS_NULLPTR 1
  627. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  628. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
  629. # endif // defined(__GNUC__)
  630. # if defined(BOOST_ASIO_MSVC)
  631. # if (_MSC_VER >= 1700)
  632. # define BOOST_ASIO_HAS_NULLPTR 1
  633. # endif // (_MSC_VER >= 1700)
  634. # endif // defined(BOOST_ASIO_MSVC)
  635. # endif // !defined(BOOST_ASIO_DISABLE_NULLPTR)
  636. #endif // !defined(BOOST_ASIO_HAS_NULLPTR)
  637. // Standard library support for the C++11 allocator additions.
  638. #if !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
  639. # if !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
  640. # if defined(__clang__)
  641. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  642. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  643. # elif (__cplusplus >= 201103)
  644. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  645. # endif // (__cplusplus >= 201103)
  646. # elif defined(__GNUC__)
  647. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  648. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  649. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  650. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  651. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  652. # endif // defined(__GNUC__)
  653. # if defined(BOOST_ASIO_MSVC)
  654. # if (_MSC_VER >= 1800)
  655. # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
  656. # endif // (_MSC_VER >= 1800)
  657. # endif // defined(BOOST_ASIO_MSVC)
  658. # endif // !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
  659. #endif // !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
  660. // Standard library support for the cstdint header.
  661. #if !defined(BOOST_ASIO_HAS_CSTDINT)
  662. # if !defined(BOOST_ASIO_DISABLE_CSTDINT)
  663. # if defined(__clang__)
  664. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  665. # define BOOST_ASIO_HAS_CSTDINT 1
  666. # elif (__cplusplus >= 201103)
  667. # define BOOST_ASIO_HAS_CSTDINT 1
  668. # endif // (__cplusplus >= 201103)
  669. # endif // defined(__clang__)
  670. # if defined(__GNUC__)
  671. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  672. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  673. # define BOOST_ASIO_HAS_CSTDINT 1
  674. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  675. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
  676. # endif // defined(__GNUC__)
  677. # if defined(BOOST_ASIO_MSVC)
  678. # if (_MSC_VER >= 1700)
  679. # define BOOST_ASIO_HAS_CSTDINT 1
  680. # endif // (_MSC_VER >= 1700)
  681. # endif // defined(BOOST_ASIO_MSVC)
  682. # endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
  683. #endif // !defined(BOOST_ASIO_HAS_CSTDINT)
  684. // Standard library support for the thread class.
  685. #if !defined(BOOST_ASIO_HAS_STD_THREAD)
  686. # if !defined(BOOST_ASIO_DISABLE_STD_THREAD)
  687. # if defined(__clang__)
  688. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  689. # define BOOST_ASIO_HAS_STD_THREAD 1
  690. # elif (__cplusplus >= 201103)
  691. # if __has_include(<thread>)
  692. # define BOOST_ASIO_HAS_STD_THREAD 1
  693. # endif // __has_include(<thread>)
  694. # endif // (__cplusplus >= 201103)
  695. # endif // defined(__clang__)
  696. # if defined(__GNUC__)
  697. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  698. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  699. # define BOOST_ASIO_HAS_STD_THREAD 1
  700. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  701. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  702. # endif // defined(__GNUC__)
  703. # if defined(BOOST_ASIO_MSVC)
  704. # if (_MSC_VER >= 1700)
  705. # define BOOST_ASIO_HAS_STD_THREAD 1
  706. # endif // (_MSC_VER >= 1700)
  707. # endif // defined(BOOST_ASIO_MSVC)
  708. # endif // !defined(BOOST_ASIO_DISABLE_STD_THREAD)
  709. #endif // !defined(BOOST_ASIO_HAS_STD_THREAD)
  710. // Standard library support for the mutex and condition variable classes.
  711. #if !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
  712. # if !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
  713. # if defined(__clang__)
  714. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  715. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  716. # elif (__cplusplus >= 201103)
  717. # if __has_include(<mutex>)
  718. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  719. # endif // __has_include(<mutex>)
  720. # endif // (__cplusplus >= 201103)
  721. # endif // defined(__clang__)
  722. # if defined(__GNUC__)
  723. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  724. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  725. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  726. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  727. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  728. # endif // defined(__GNUC__)
  729. # if defined(BOOST_ASIO_MSVC)
  730. # if (_MSC_VER >= 1700)
  731. # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
  732. # endif // (_MSC_VER >= 1700)
  733. # endif // defined(BOOST_ASIO_MSVC)
  734. # endif // !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
  735. #endif // !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
  736. // Standard library support for the call_once function.
  737. #if !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
  738. # if !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
  739. # if defined(__clang__)
  740. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  741. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  742. # elif (__cplusplus >= 201103)
  743. # if __has_include(<mutex>)
  744. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  745. # endif // __has_include(<mutex>)
  746. # endif // (__cplusplus >= 201103)
  747. # endif // defined(__clang__)
  748. # if defined(__GNUC__)
  749. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  750. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  751. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  752. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  753. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  754. # endif // defined(__GNUC__)
  755. # if defined(BOOST_ASIO_MSVC)
  756. # if (_MSC_VER >= 1700)
  757. # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
  758. # endif // (_MSC_VER >= 1700)
  759. # endif // defined(BOOST_ASIO_MSVC)
  760. # endif // !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
  761. #endif // !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
  762. // Standard library support for futures.
  763. #if !defined(BOOST_ASIO_HAS_STD_FUTURE)
  764. # if !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
  765. # if defined(__clang__)
  766. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  767. # define BOOST_ASIO_HAS_STD_FUTURE 1
  768. # elif (__cplusplus >= 201103)
  769. # if __has_include(<future>)
  770. # define BOOST_ASIO_HAS_STD_FUTURE 1
  771. # endif // __has_include(<mutex>)
  772. # endif // (__cplusplus >= 201103)
  773. # endif // defined(__clang__)
  774. # if defined(__GNUC__)
  775. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  776. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  777. # define BOOST_ASIO_HAS_STD_FUTURE 1
  778. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  779. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
  780. # endif // defined(__GNUC__)
  781. # if defined(BOOST_ASIO_MSVC)
  782. # if (_MSC_VER >= 1700)
  783. # define BOOST_ASIO_HAS_STD_FUTURE 1
  784. # endif // (_MSC_VER >= 1700)
  785. # endif // defined(BOOST_ASIO_MSVC)
  786. # endif // !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
  787. #endif // !defined(BOOST_ASIO_HAS_STD_FUTURE)
  788. // Standard library support for std::string_view.
  789. #if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  790. # if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
  791. # if defined(__clang__)
  792. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  793. # if (__cplusplus >= 201402)
  794. # if __has_include(<string_view>)
  795. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  796. # endif // __has_include(<string_view>)
  797. # endif // (__cplusplus >= 201402)
  798. # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  799. # if (__cplusplus >= 201703)
  800. # if __has_include(<string_view>)
  801. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  802. # endif // __has_include(<string_view>)
  803. # endif // (__cplusplus >= 201703)
  804. # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  805. # elif defined(__GNUC__)
  806. # if (__GNUC__ >= 7)
  807. # if (__cplusplus >= 201703)
  808. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  809. # endif // (__cplusplus >= 201703)
  810. # endif // (__GNUC__ >= 7)
  811. # elif defined(BOOST_ASIO_MSVC)
  812. # if (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
  813. # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
  814. # endif // (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
  815. # endif // defined(BOOST_ASIO_MSVC)
  816. # endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
  817. #endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  818. // Standard library support for std::experimental::string_view.
  819. #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  820. # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
  821. # if defined(__clang__)
  822. # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  823. # if (_LIBCPP_VERSION < 7000)
  824. # if (__cplusplus >= 201402)
  825. # if __has_include(<experimental/string_view>)
  826. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  827. # endif // __has_include(<experimental/string_view>)
  828. # endif // (__cplusplus >= 201402)
  829. # endif // (_LIBCPP_VERSION < 7000)
  830. # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  831. # if (__cplusplus >= 201402)
  832. # if __has_include(<experimental/string_view>)
  833. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  834. # endif // __has_include(<experimental/string_view>)
  835. # endif // (__cplusplus >= 201402)
  836. # endif // // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
  837. # endif // defined(__clang__)
  838. # if defined(__GNUC__)
  839. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  840. # if (__cplusplus >= 201402)
  841. # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
  842. # endif // (__cplusplus >= 201402)
  843. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
  844. # endif // defined(__GNUC__)
  845. # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
  846. #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  847. // Standard library has a string_view that we can use.
  848. #if !defined(BOOST_ASIO_HAS_STRING_VIEW)
  849. # if !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
  850. # if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
  851. # define BOOST_ASIO_HAS_STRING_VIEW 1
  852. # elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  853. # define BOOST_ASIO_HAS_STRING_VIEW 1
  854. # endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
  855. # endif // !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
  856. #endif // !defined(BOOST_ASIO_HAS_STRING_VIEW)
  857. // Standard library support for iostream move construction and assignment.
  858. #if !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
  859. # if !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
  860. # if defined(__GNUC__)
  861. # if (__GNUC__ > 4)
  862. # if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  863. # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
  864. # endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  865. # endif // (__GNUC__ > 4)
  866. # endif // defined(__GNUC__)
  867. # if defined(BOOST_ASIO_MSVC)
  868. # if (_MSC_VER >= 1700)
  869. # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
  870. # endif // (_MSC_VER >= 1700)
  871. # endif // defined(BOOST_ASIO_MSVC)
  872. # endif // !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
  873. #endif // !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
  874. // Standard library has invoke_result (which supersedes result_of).
  875. #if !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
  876. # if !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
  877. # if defined(BOOST_ASIO_MSVC)
  878. # if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
  879. # define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
  880. # endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
  881. # endif // defined(BOOST_ASIO_MSVC)
  882. # endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
  883. #endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
  884. // Windows App target. Windows but with a limited API.
  885. #if !defined(BOOST_ASIO_WINDOWS_APP)
  886. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
  887. # include <winapifamily.h>
  888. # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
  889. || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)) \
  890. && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  891. # define BOOST_ASIO_WINDOWS_APP 1
  892. # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  893. // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  894. # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
  895. #endif // !defined(BOOST_ASIO_WINDOWS_APP)
  896. // Legacy WinRT target. Windows App is preferred.
  897. #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  898. # if !defined(BOOST_ASIO_WINDOWS_APP)
  899. # if defined(__cplusplus_winrt)
  900. # include <winapifamily.h>
  901. # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
  902. && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  903. # define BOOST_ASIO_WINDOWS_RUNTIME 1
  904. # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  905. // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  906. # endif // defined(__cplusplus_winrt)
  907. # endif // !defined(BOOST_ASIO_WINDOWS_APP)
  908. #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  909. // Windows target. Excludes WinRT but includes Windows App targets.
  910. #if !defined(BOOST_ASIO_WINDOWS)
  911. # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  912. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
  913. # define BOOST_ASIO_WINDOWS 1
  914. # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  915. # define BOOST_ASIO_WINDOWS 1
  916. # elif defined(BOOST_ASIO_WINDOWS_APP)
  917. # define BOOST_ASIO_WINDOWS 1
  918. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
  919. # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  920. #endif // !defined(BOOST_ASIO_WINDOWS)
  921. // Windows: target OS version.
  922. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  923. # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
  924. # if defined(_MSC_VER) || defined(__BORLANDC__)
  925. # pragma message( \
  926. "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
  927. "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\
  928. "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\
  929. "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).")
  930. # else // defined(_MSC_VER) || defined(__BORLANDC__)
  931. # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
  932. # warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line.
  933. # warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
  934. # endif // defined(_MSC_VER) || defined(__BORLANDC__)
  935. # define _WIN32_WINNT 0x0601
  936. # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
  937. # if defined(_MSC_VER)
  938. # if defined(_WIN32) && !defined(WIN32)
  939. # if !defined(_WINSOCK2API_)
  940. # define WIN32 // Needed for correct types in winsock2.h
  941. # else // !defined(_WINSOCK2API_)
  942. # error Please define the macro WIN32 in your compiler options
  943. # endif // !defined(_WINSOCK2API_)
  944. # endif // defined(_WIN32) && !defined(WIN32)
  945. # endif // defined(_MSC_VER)
  946. # if defined(__BORLANDC__)
  947. # if defined(__WIN32__) && !defined(WIN32)
  948. # if !defined(_WINSOCK2API_)
  949. # define WIN32 // Needed for correct types in winsock2.h
  950. # else // !defined(_WINSOCK2API_)
  951. # error Please define the macro WIN32 in your compiler options
  952. # endif // !defined(_WINSOCK2API_)
  953. # endif // defined(__WIN32__) && !defined(WIN32)
  954. # endif // defined(__BORLANDC__)
  955. # if defined(__CYGWIN__)
  956. # if !defined(__USE_W32_SOCKETS)
  957. # error You must add -D__USE_W32_SOCKETS to your compiler options.
  958. # endif // !defined(__USE_W32_SOCKETS)
  959. # endif // defined(__CYGWIN__)
  960. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  961. // Windows: minimise header inclusion.
  962. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  963. # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
  964. # if !defined(WIN32_LEAN_AND_MEAN)
  965. # define WIN32_LEAN_AND_MEAN
  966. # endif // !defined(WIN32_LEAN_AND_MEAN)
  967. # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
  968. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  969. // Windows: suppress definition of "min" and "max" macros.
  970. #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  971. # if !defined(BOOST_ASIO_NO_NOMINMAX)
  972. # if !defined(NOMINMAX)
  973. # define NOMINMAX 1
  974. # endif // !defined(NOMINMAX)
  975. # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
  976. #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  977. // Windows: IO Completion Ports.
  978. #if !defined(BOOST_ASIO_HAS_IOCP)
  979. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  980. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
  981. # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  982. # if !defined(BOOST_ASIO_DISABLE_IOCP)
  983. # define BOOST_ASIO_HAS_IOCP 1
  984. # endif // !defined(BOOST_ASIO_DISABLE_IOCP)
  985. # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  986. # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
  987. # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  988. #endif // !defined(BOOST_ASIO_HAS_IOCP)
  989. // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
  990. // get access to the various platform feature macros, e.g. to be able to test
  991. // for threads support.
  992. #if !defined(BOOST_ASIO_HAS_UNISTD_H)
  993. # if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  994. # if defined(unix) \
  995. || defined(__unix) \
  996. || defined(_XOPEN_SOURCE) \
  997. || defined(_POSIX_SOURCE) \
  998. || (defined(__MACH__) && defined(__APPLE__)) \
  999. || defined(__FreeBSD__) \
  1000. || defined(__NetBSD__) \
  1001. || defined(__OpenBSD__) \
  1002. || defined(__linux__) \
  1003. || defined(__HAIKU__)
  1004. # define BOOST_ASIO_HAS_UNISTD_H 1
  1005. # endif
  1006. # endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
  1007. #endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
  1008. #if defined(BOOST_ASIO_HAS_UNISTD_H)
  1009. # include <unistd.h>
  1010. #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
  1011. // Linux: epoll, eventfd and timerfd.
  1012. #if defined(__linux__)
  1013. # include <linux/version.h>
  1014. # if !defined(BOOST_ASIO_HAS_EPOLL)
  1015. # if !defined(BOOST_ASIO_DISABLE_EPOLL)
  1016. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
  1017. # define BOOST_ASIO_HAS_EPOLL 1
  1018. # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
  1019. # endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
  1020. # endif // !defined(BOOST_ASIO_HAS_EPOLL)
  1021. # if !defined(BOOST_ASIO_HAS_EVENTFD)
  1022. # if !defined(BOOST_ASIO_DISABLE_EVENTFD)
  1023. # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  1024. # define BOOST_ASIO_HAS_EVENTFD 1
  1025. # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  1026. # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
  1027. # endif // !defined(BOOST_ASIO_HAS_EVENTFD)
  1028. # if !defined(BOOST_ASIO_HAS_TIMERFD)
  1029. # if defined(BOOST_ASIO_HAS_EPOLL)
  1030. # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
  1031. # define BOOST_ASIO_HAS_TIMERFD 1
  1032. # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
  1033. # endif // defined(BOOST_ASIO_HAS_EPOLL)
  1034. # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
  1035. #endif // defined(__linux__)
  1036. // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
  1037. #if (defined(__MACH__) && defined(__APPLE__)) \
  1038. || defined(__FreeBSD__) \
  1039. || defined(__NetBSD__) \
  1040. || defined(__OpenBSD__)
  1041. # if !defined(BOOST_ASIO_HAS_KQUEUE)
  1042. # if !defined(BOOST_ASIO_DISABLE_KQUEUE)
  1043. # define BOOST_ASIO_HAS_KQUEUE 1
  1044. # endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
  1045. # endif // !defined(BOOST_ASIO_HAS_KQUEUE)
  1046. #endif // (defined(__MACH__) && defined(__APPLE__))
  1047. // || defined(__FreeBSD__)
  1048. // || defined(__NetBSD__)
  1049. // || defined(__OpenBSD__)
  1050. // Solaris: /dev/poll.
  1051. #if defined(__sun)
  1052. # if !defined(BOOST_ASIO_HAS_DEV_POLL)
  1053. # if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
  1054. # define BOOST_ASIO_HAS_DEV_POLL 1
  1055. # endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
  1056. # endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
  1057. #endif // defined(__sun)
  1058. // Serial ports.
  1059. #if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
  1060. # if defined(BOOST_ASIO_HAS_IOCP) \
  1061. || !defined(BOOST_ASIO_WINDOWS) \
  1062. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1063. && !defined(__CYGWIN__)
  1064. # if !defined(__SYMBIAN32__)
  1065. # if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
  1066. # define BOOST_ASIO_HAS_SERIAL_PORT 1
  1067. # endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
  1068. # endif // !defined(__SYMBIAN32__)
  1069. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1070. // || !defined(BOOST_ASIO_WINDOWS)
  1071. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1072. // && !defined(__CYGWIN__)
  1073. #endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
  1074. // Windows: stream handles.
  1075. #if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
  1076. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
  1077. # if defined(BOOST_ASIO_HAS_IOCP)
  1078. # define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
  1079. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1080. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
  1081. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
  1082. // Windows: random access handles.
  1083. #if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  1084. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
  1085. # if defined(BOOST_ASIO_HAS_IOCP)
  1086. # define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
  1087. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1088. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
  1089. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
  1090. // Windows: object handles.
  1091. #if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
  1092. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
  1093. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1094. # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  1095. # define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
  1096. # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
  1097. # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1098. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
  1099. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
  1100. // Windows: OVERLAPPED wrapper.
  1101. #if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
  1102. # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
  1103. # if defined(BOOST_ASIO_HAS_IOCP)
  1104. # define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
  1105. # endif // defined(BOOST_ASIO_HAS_IOCP)
  1106. # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
  1107. #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
  1108. // POSIX: stream-oriented file descriptors.
  1109. #if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
  1110. # if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
  1111. # if !defined(BOOST_ASIO_WINDOWS) \
  1112. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1113. && !defined(__CYGWIN__)
  1114. # define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
  1115. # endif // !defined(BOOST_ASIO_WINDOWS)
  1116. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1117. // && !defined(__CYGWIN__)
  1118. # endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
  1119. #endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
  1120. // UNIX domain sockets.
  1121. #if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
  1122. # if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
  1123. # if !defined(BOOST_ASIO_WINDOWS) \
  1124. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1125. && !defined(__CYGWIN__)
  1126. # define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
  1127. # endif // !defined(BOOST_ASIO_WINDOWS)
  1128. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1129. // && !defined(__CYGWIN__)
  1130. # endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
  1131. #endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
  1132. // Can use sigaction() instead of signal().
  1133. #if !defined(BOOST_ASIO_HAS_SIGACTION)
  1134. # if !defined(BOOST_ASIO_DISABLE_SIGACTION)
  1135. # if !defined(BOOST_ASIO_WINDOWS) \
  1136. && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
  1137. && !defined(__CYGWIN__)
  1138. # define BOOST_ASIO_HAS_SIGACTION 1
  1139. # endif // !defined(BOOST_ASIO_WINDOWS)
  1140. // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1141. // && !defined(__CYGWIN__)
  1142. # endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
  1143. #endif // !defined(BOOST_ASIO_HAS_SIGACTION)
  1144. // Can use signal().
  1145. #if !defined(BOOST_ASIO_HAS_SIGNAL)
  1146. # if !defined(BOOST_ASIO_DISABLE_SIGNAL)
  1147. # if !defined(UNDER_CE)
  1148. # define BOOST_ASIO_HAS_SIGNAL 1
  1149. # endif // !defined(UNDER_CE)
  1150. # endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
  1151. #endif // !defined(BOOST_ASIO_HAS_SIGNAL)
  1152. // Can use getaddrinfo() and getnameinfo().
  1153. #if !defined(BOOST_ASIO_HAS_GETADDRINFO)
  1154. # if !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
  1155. # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
  1156. # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
  1157. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1158. # elif defined(UNDER_CE)
  1159. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1160. # endif // defined(UNDER_CE)
  1161. # elif defined(__MACH__) && defined(__APPLE__)
  1162. # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  1163. # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
  1164. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1165. # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
  1166. # else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  1167. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1168. # endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
  1169. # else // defined(__MACH__) && defined(__APPLE__)
  1170. # define BOOST_ASIO_HAS_GETADDRINFO 1
  1171. # endif // defined(__MACH__) && defined(__APPLE__)
  1172. # endif // !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
  1173. #endif // !defined(BOOST_ASIO_HAS_GETADDRINFO)
  1174. // Whether standard iostreams are disabled.
  1175. #if !defined(BOOST_ASIO_NO_IOSTREAM)
  1176. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
  1177. # define BOOST_ASIO_NO_IOSTREAM 1
  1178. # endif // !defined(BOOST_NO_IOSTREAM)
  1179. #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
  1180. // Whether exception handling is disabled.
  1181. #if !defined(BOOST_ASIO_NO_EXCEPTIONS)
  1182. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
  1183. # define BOOST_ASIO_NO_EXCEPTIONS 1
  1184. # endif // !defined(BOOST_NO_EXCEPTIONS)
  1185. #endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
  1186. // Whether the typeid operator is supported.
  1187. #if !defined(BOOST_ASIO_NO_TYPEID)
  1188. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
  1189. # define BOOST_ASIO_NO_TYPEID 1
  1190. # endif // !defined(BOOST_NO_TYPEID)
  1191. #endif // !defined(BOOST_ASIO_NO_TYPEID)
  1192. // Threads.
  1193. #if !defined(BOOST_ASIO_HAS_THREADS)
  1194. # if !defined(BOOST_ASIO_DISABLE_THREADS)
  1195. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
  1196. # define BOOST_ASIO_HAS_THREADS 1
  1197. # elif defined(__GNUC__) && !defined(__MINGW32__) \
  1198. && !defined(linux) && !defined(__linux) && !defined(__linux__)
  1199. # define BOOST_ASIO_HAS_THREADS 1
  1200. # elif defined(_MT) || defined(__MT__)
  1201. # define BOOST_ASIO_HAS_THREADS 1
  1202. # elif defined(_REENTRANT)
  1203. # define BOOST_ASIO_HAS_THREADS 1
  1204. # elif defined(__APPLE__)
  1205. # define BOOST_ASIO_HAS_THREADS 1
  1206. # elif defined(__HAIKU__)
  1207. # define BOOST_ASIO_HAS_THREADS 1
  1208. # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
  1209. # define BOOST_ASIO_HAS_THREADS 1
  1210. # elif defined(_PTHREADS)
  1211. # define BOOST_ASIO_HAS_THREADS 1
  1212. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
  1213. # endif // !defined(BOOST_ASIO_DISABLE_THREADS)
  1214. #endif // !defined(BOOST_ASIO_HAS_THREADS)
  1215. // POSIX threads.
  1216. #if !defined(BOOST_ASIO_HAS_PTHREADS)
  1217. # if defined(BOOST_ASIO_HAS_THREADS)
  1218. # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
  1219. # define BOOST_ASIO_HAS_PTHREADS 1
  1220. # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
  1221. # define BOOST_ASIO_HAS_PTHREADS 1
  1222. # elif defined(__HAIKU__)
  1223. # define BOOST_ASIO_HAS_PTHREADS 1
  1224. # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
  1225. # endif // defined(BOOST_ASIO_HAS_THREADS)
  1226. #endif // !defined(BOOST_ASIO_HAS_PTHREADS)
  1227. // Helper to prevent macro expansion.
  1228. #define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
  1229. // Helper to define in-class constants.
  1230. #if !defined(BOOST_ASIO_STATIC_CONSTANT)
  1231. # if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1232. # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
  1233. BOOST_STATIC_CONSTANT(type, assignment)
  1234. # else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1235. # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
  1236. static const type assignment
  1237. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
  1238. #endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
  1239. // Boost array library.
  1240. #if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
  1241. # if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
  1242. # define BOOST_ASIO_HAS_BOOST_ARRAY 1
  1243. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
  1244. #endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
  1245. // Boost assert macro.
  1246. #if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
  1247. # if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
  1248. # define BOOST_ASIO_HAS_BOOST_ASSERT 1
  1249. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
  1250. #endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
  1251. // Boost limits header.
  1252. #if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
  1253. # if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
  1254. # define BOOST_ASIO_HAS_BOOST_LIMITS 1
  1255. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
  1256. #endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
  1257. // Boost throw_exception function.
  1258. #if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
  1259. # if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
  1260. # define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
  1261. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
  1262. #endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
  1263. // Boost regex library.
  1264. #if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
  1265. # if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
  1266. # define BOOST_ASIO_HAS_BOOST_REGEX 1
  1267. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
  1268. #endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
  1269. // Boost bind function.
  1270. #if !defined(BOOST_ASIO_HAS_BOOST_BIND)
  1271. # if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
  1272. # define BOOST_ASIO_HAS_BOOST_BIND 1
  1273. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
  1274. #endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
  1275. // Boost's BOOST_WORKAROUND macro.
  1276. #if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
  1277. # if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
  1278. # define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
  1279. # endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
  1280. #endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
  1281. // Microsoft Visual C++'s secure C runtime library.
  1282. #if !defined(BOOST_ASIO_HAS_SECURE_RTL)
  1283. # if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
  1284. # if defined(BOOST_ASIO_MSVC) \
  1285. && (BOOST_ASIO_MSVC >= 1400) \
  1286. && !defined(UNDER_CE)
  1287. # define BOOST_ASIO_HAS_SECURE_RTL 1
  1288. # endif // defined(BOOST_ASIO_MSVC)
  1289. // && (BOOST_ASIO_MSVC >= 1400)
  1290. // && !defined(UNDER_CE)
  1291. # endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
  1292. #endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
  1293. // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
  1294. #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
  1295. # if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
  1296. # if defined(__GNUC__)
  1297. # if (__GNUC__ >= 3)
  1298. # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
  1299. # endif // (__GNUC__ >= 3)
  1300. # elif !defined(__BORLANDC__)
  1301. # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
  1302. # endif // !defined(__BORLANDC__)
  1303. # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
  1304. #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
  1305. // Support for the __thread keyword extension.
  1306. #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
  1307. # if defined(__linux__)
  1308. # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  1309. # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
  1310. # if !defined(__INTEL_COMPILER) && !defined(__ICL) \
  1311. && !(defined(__clang__) && defined(__ANDROID__))
  1312. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1313. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1314. # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
  1315. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1316. # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
  1317. // && !(defined(__clang__) && defined(__ANDROID__))
  1318. # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
  1319. # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
  1320. # endif // defined(__linux__)
  1321. # if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1322. # if (_MSC_VER >= 1700)
  1323. # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
  1324. # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
  1325. # endif // (_MSC_VER >= 1700)
  1326. # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
  1327. #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
  1328. #if !defined(BOOST_ASIO_THREAD_KEYWORD)
  1329. # define BOOST_ASIO_THREAD_KEYWORD __thread
  1330. #endif // !defined(BOOST_ASIO_THREAD_KEYWORD)
  1331. // Support for POSIX ssize_t typedef.
  1332. #if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
  1333. # if defined(__linux__) \
  1334. || (defined(__MACH__) && defined(__APPLE__))
  1335. # define BOOST_ASIO_HAS_SSIZE_T 1
  1336. # endif // defined(__linux__)
  1337. // || (defined(__MACH__) && defined(__APPLE__))
  1338. #endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
  1339. // Helper macros to manage transition away from error_code return values.
  1340. #if defined(BOOST_ASIO_NO_DEPRECATED)
  1341. # define BOOST_ASIO_SYNC_OP_VOID void
  1342. # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return
  1343. #else // defined(BOOST_ASIO_NO_DEPRECATED)
  1344. # define BOOST_ASIO_SYNC_OP_VOID boost::system::error_code
  1345. # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return e
  1346. #endif // defined(BOOST_ASIO_NO_DEPRECATED)
  1347. // Newer gcc, clang need special treatment to suppress unused typedef warnings.
  1348. #if defined(__clang__)
  1349. # if defined(__apple_build_version__)
  1350. # if (__clang_major__ >= 7)
  1351. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1352. # endif // (__clang_major__ >= 7)
  1353. # elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \
  1354. || (__clang_major__ > 3)
  1355. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1356. # endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6))
  1357. // || (__clang_major__ > 3)
  1358. #elif defined(__GNUC__)
  1359. # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1360. # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
  1361. # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
  1362. #endif // defined(__GNUC__)
  1363. #if !defined(BOOST_ASIO_UNUSED_TYPEDEF)
  1364. # define BOOST_ASIO_UNUSED_TYPEDEF
  1365. #endif // !defined(BOOST_ASIO_UNUSED_TYPEDEF)
  1366. // Some versions of gcc generate spurious warnings about unused variables.
  1367. #if defined(__GNUC__)
  1368. # if (__GNUC__ >= 4)
  1369. # define BOOST_ASIO_UNUSED_VARIABLE __attribute__((__unused__))
  1370. # endif // (__GNUC__ >= 4)
  1371. #endif // defined(__GNUC__)
  1372. #if !defined(BOOST_ASIO_UNUSED_VARIABLE)
  1373. # define BOOST_ASIO_UNUSED_VARIABLE
  1374. #endif // !defined(BOOST_ASIO_UNUSED_VARIABLE)
  1375. // Support co_await on compilers known to allow it.
  1376. #if !defined(BOOST_ASIO_HAS_CO_AWAIT)
  1377. # if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
  1378. # if defined(BOOST_ASIO_MSVC)
  1379. # if (_MSC_FULL_VER >= 190023506)
  1380. # if defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
  1381. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1382. # endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
  1383. # endif // (_MSC_FULL_VER >= 190023506)
  1384. # endif // defined(BOOST_ASIO_MSVC)
  1385. # endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
  1386. # if defined(__clang__)
  1387. # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  1388. # if __has_include(<experimental/coroutine>)
  1389. # define BOOST_ASIO_HAS_CO_AWAIT 1
  1390. # endif // __has_include(<experimental/coroutine>)
  1391. # endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
  1392. # endif // defined(__clang__)
  1393. #endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
  1394. #endif // BOOST_ASIO_DETAIL_CONFIG_HPP