config.hpp 58 KB

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