config.hpp 58 KB

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