From d7fc4b75fc6fbed69836d8ccd39bc5cbbbcca88d Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 25 Oct 2010 12:57:23 +0000 Subject: [PATCH] Merge from trunk: Rename separate compilation header. Fixes #4560. [SVN r66175] --- doc/using.qbk | 9 +++++ include/boost/asio/impl/src.cpp | 60 +++++++------------------------ include/boost/asio/impl/src.hpp | 64 +++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 47 deletions(-) create mode 100644 include/boost/asio/impl/src.hpp diff --git a/doc/using.qbk b/doc/using.qbk index 8b1786dd..267e540d 100644 --- a/doc/using.qbk +++ b/doc/using.qbk @@ -130,6 +130,15 @@ name of the `boost_system` library may vary depending on the compiler version): ] +[heading Optional separate compilation] + +By default, Boost.Asio is a header-only library. However, some developers may +prefer to build Boost.Asio using separately compiled source code. To do this, +add `#include ` to one (and only one) source file in a +program, then build the program with `BOOST_ASIO_SEPARATE_COMPILATION` defined +in the project\/compiler settings. Alternatively, `BOOST_ASIO_DYN_LINK` may be +defined to build a separately-compiled Boost.Asio as part of a shared library. + [heading Macros] The macros listed in the table below may be used to control the behaviour of diff --git a/include/boost/asio/impl/src.cpp b/include/boost/asio/impl/src.cpp index 59a10c95..fa418563 100644 --- a/include/boost/asio/impl/src.cpp +++ b/include/boost/asio/impl/src.cpp @@ -8,52 +8,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#define BOOST_ASIO_SOURCE - -#include - -#if defined(BOOST_ASIO_HEADER_ONLY) -# error Do not compile Asio library source with BOOST_ASIO_HEADER_ONLY defined +#if defined(_MSC_VER) \ + || defined(__BORLANDC__) \ + || defined(__DMC__) +# pragma message ( \ + "This file is deprecated. " \ + "Please #include instead.>) +#elif defined(__GNUC__) \ + || defined(__HP_aCC) \ + || defined(__SUNPRO_CC) \ + || defined(__IBMCPP__) +# warning "This file is deprecated." +# warning "Please #include instead.> #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include diff --git a/include/boost/asio/impl/src.hpp b/include/boost/asio/impl/src.hpp new file mode 100644 index 00000000..60f92d5a --- /dev/null +++ b/include/boost/asio/impl/src.hpp @@ -0,0 +1,64 @@ +// +// impl/src.hpp +// ~~~~~~~~~~~~ +// +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_IMPL_SRC_HPP +#define BOOST_ASIO_IMPL_SRC_HPP + +#define BOOST_ASIO_SOURCE + +#include + +#if defined(BOOST_ASIO_HEADER_ONLY) +# error Do not compile Asio library source with BOOST_ASIO_HEADER_ONLY defined +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_ASIO_IMPL_SRC_HPP