Ticket #10174: boost_asio_call_stack_static_storage_win32.patch

File boost_asio_call_stack_static_storage_win32.patch, 3.1 KB (added by wberrier@…, 7 years ago)

force call_stack static storage to shared library

  • boost/asio/detail/call_stack.hpp

    diff -urN boost_1_55_0.orig/boost/asio/detail/call_stack.hpp boost_1_55_0/boost/asio/detail/call_stack.hpp
    old new  
    1919#include <boost/asio/detail/noncopyable.hpp>
    2020#include <boost/asio/detail/tss_ptr.hpp>
    2121
     22// HACK to only export symbol on windows since gcc doesn't like this for inlines
     23#if defined(BOOST_ASIO_WINDOWS)
     24#define BOOST_ASIO_DECL_WINDOWS BOOST_ASIO_DECL
     25#else
     26#define BOOST_ASIO_DECL_WINDOWS
     27#endif
     28
    2229#include <boost/asio/detail/push_options.hpp>
    2330
    2431namespace boost {
     
    111118
    112119private:
    113120  // The top of the stack of calls for the current thread.
    114   static tss_ptr<context> top_;
     121  BOOST_ASIO_DECL_WINDOWS static tss_ptr<context> top_;
    115122};
    116123
    117 template <typename Key, typename Value>
    118 tss_ptr<typename call_stack<Key, Value>::context>
    119 call_stack<Key, Value>::top_;
    120 
    121124} // namespace detail
    122125} // namespace asio
    123126} // namespace boost
    124127
    125128#include <boost/asio/detail/pop_options.hpp>
    126129
     130#if defined(BOOST_ASIO_HEADER_ONLY)
     131# include <boost/asio/detail/call_stack.ipp>
     132#endif // defined(BOOST_ASIO_HEADER_ONLY)
     133
    127134#endif // BOOST_ASIO_DETAIL_CALL_STACK_HPP
  • boost/asio/detail/call_stack.ipp

    diff -urN boost_1_55_0.orig/boost/asio/detail/call_stack.ipp boost_1_55_0/boost/asio/detail/call_stack.ipp
    old new  
     1//
     2// detail/call_stack.ipp
     3// ~~~~~~~~~~~~~~~~~~~~~
     4//
     5// Copyright (c) 2003-2013 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
     11#ifndef BOOST_ASIO_DETAIL_CALL_STACK_IPP
     12#define BOOST_ASIO_DETAIL_CALL_STACK_IPP
     13
     14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
     15# pragma once
     16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
     17
     18#include <boost/asio/detail/config.hpp>
     19
     20#include <boost/asio/detail/call_stack.hpp>
     21
     22#include <boost/asio/detail/push_options.hpp>
     23
     24namespace boost {
     25namespace asio {
     26namespace detail {
     27
     28template <typename Key, typename Value>
     29tss_ptr<typename call_stack<Key, Value>::context>
     30BOOST_ASIO_DECL_WINDOWS call_stack<Key, Value>::top_;
     31
     32} // namespace detail
     33} // namespace asio
     34} // namespace boost
     35
     36#include <boost/asio/detail/pop_options.hpp>
     37
     38#endif // BOOST_ASIO_DETAIL_CALL_STACK_IPP
  • boost/asio/impl/src.hpp

    diff -urN boost_1_55_0.orig/boost/asio/impl/src.hpp boost_1_55_0/boost/asio/impl/src.hpp
    old new  
    2323#include <boost/asio/impl/handler_alloc_hook.ipp>
    2424#include <boost/asio/impl/io_service.ipp>
    2525#include <boost/asio/impl/serial_port_base.ipp>
     26#include <boost/asio/detail/call_stack.ipp>
    2627#include <boost/asio/detail/impl/buffer_sequence_adapter.ipp>
    2728#include <boost/asio/detail/impl/descriptor_ops.ipp>
    2829#include <boost/asio/detail/impl/dev_poll_reactor.ipp>