annotate DEPENDENCIES/generic/include/boost/asio/detail/impl/win_tss_ptr.ipp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 //
Chris@16 2 // detail/impl/win_tss_ptr.ipp
Chris@16 3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chris@16 4 //
Chris@101 5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
Chris@16 6 //
Chris@16 7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 9 //
Chris@16 10
Chris@16 11 #ifndef BOOST_ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP
Chris@16 12 #define BOOST_ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP
Chris@16 13
Chris@16 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
Chris@16 15 # pragma once
Chris@16 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
Chris@16 17
Chris@16 18 #include <boost/asio/detail/config.hpp>
Chris@16 19
Chris@16 20 #if defined(BOOST_ASIO_WINDOWS)
Chris@16 21
Chris@16 22 #include <boost/asio/detail/throw_error.hpp>
Chris@16 23 #include <boost/asio/detail/win_tss_ptr.hpp>
Chris@16 24 #include <boost/asio/error.hpp>
Chris@16 25
Chris@16 26 #include <boost/asio/detail/push_options.hpp>
Chris@16 27
Chris@16 28 namespace boost {
Chris@16 29 namespace asio {
Chris@16 30 namespace detail {
Chris@16 31
Chris@16 32 DWORD win_tss_ptr_create()
Chris@16 33 {
Chris@16 34 #if defined(UNDER_CE)
Chris@16 35 enum { out_of_indexes = 0xFFFFFFFF };
Chris@16 36 #else
Chris@16 37 enum { out_of_indexes = TLS_OUT_OF_INDEXES };
Chris@16 38 #endif
Chris@16 39
Chris@16 40 DWORD tss_key = ::TlsAlloc();
Chris@16 41 if (tss_key == out_of_indexes)
Chris@16 42 {
Chris@16 43 DWORD last_error = ::GetLastError();
Chris@16 44 boost::system::error_code ec(last_error,
Chris@16 45 boost::asio::error::get_system_category());
Chris@16 46 boost::asio::detail::throw_error(ec, "tss");
Chris@16 47 }
Chris@16 48 return tss_key;
Chris@16 49 }
Chris@16 50
Chris@16 51 } // namespace detail
Chris@16 52 } // namespace asio
Chris@16 53 } // namespace boost
Chris@16 54
Chris@16 55 #include <boost/asio/detail/pop_options.hpp>
Chris@16 56
Chris@16 57 #endif // defined(BOOST_ASIO_WINDOWS)
Chris@16 58
Chris@16 59 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP