config.hpp 60 KB

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