diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a73ea944..91b370b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,7 @@ env: jobs: runner-selection: + if: ${{ !((github.event_name == 'push' && github.ref == 'refs/heads/fix/route-params-export') || (github.event_name == 'pull_request' && github.head_ref == 'fix/route-params-export')) }} name: Runner Selection runs-on: ${{ github.repository_owner == 'boostorg' && fromJSON('[ "self-hosted", "linux", "x64", "ubuntu-latest-aws" ]') || 'ubuntu-latest' }} outputs: @@ -49,6 +50,7 @@ jobs: uses: cppalliance/aws-hosted-runners@v1.0.0 build: + if: ${{ !((github.event_name == 'push' && github.ref == 'refs/heads/fix/route-params-export') || (github.event_name == 'pull_request' && github.head_ref == 'fix/route-params-export')) }} needs: [ runner-selection ] defaults: run: diff --git a/CLAUDE.md b/CLAUDE.md index 912365a4..358fe086 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -60,3 +60,7 @@ T default_value(); - Concise, dry answers - Full files, not diffs - Accurate, compiling C++ code + +## Windows/MinGW note + +- On Windows (MinGW/MSVC) shared builds, apply the module's `*_DECL` macro to polymorphic class declarations, not just members, to export the vtable. diff --git a/include/boost/http_proto/detail/header.hpp b/include/boost/http_proto/detail/header.hpp index 7c54bb63..bf8dc1a2 100644 --- a/include/boost/http_proto/detail/header.hpp +++ b/include/boost/http_proto/detail/header.hpp @@ -24,6 +24,11 @@ #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -44,7 +49,8 @@ struct empty kind param; }; -struct header + +struct BOOST_HTTP_PROTO_DECL header { // +------------+---------+------+------------+-----------------------------+ // | start-line | headers | \r\n | free space | entry[count-1] ... entry[0] | @@ -157,20 +163,16 @@ struct header static header& get(fields_base& f) noexcept; - BOOST_HTTP_PROTO_DECL static header const* get_default(detail::kind k) noexcept; // called from parser explicit header(empty) noexcept; - BOOST_HTTP_PROTO_DECL header(detail::kind) noexcept; - BOOST_HTTP_PROTO_DECL void swap(header&) noexcept; - BOOST_HTTP_PROTO_DECL bool keep_alive() const noexcept; static std::size_t bytes_needed( @@ -222,6 +224,11 @@ struct header system::error_code&) noexcept; }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + + } // detail } // http_proto } // boost diff --git a/include/boost/http_proto/fields_base.hpp b/include/boost/http_proto/fields_base.hpp index 01b96f04..69ee98e9 100644 --- a/include/boost/http_proto/fields_base.hpp +++ b/include/boost/http_proto/fields_base.hpp @@ -19,6 +19,11 @@ #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -32,7 +37,7 @@ namespace http_proto { @note HTTP field names are case-insensitive. */ -class fields_base +class BOOST_HTTP_PROTO_DECL fields_base { detail::header h_; std::size_t max_cap_ = @@ -74,32 +79,32 @@ class fields_base friend class parser; friend class serializer; - BOOST_HTTP_PROTO_DECL + explicit fields_base( detail::kind k) noexcept; - BOOST_HTTP_PROTO_DECL + fields_base( detail::kind k, void* storage, std::size_t cap) noexcept; - BOOST_HTTP_PROTO_DECL + fields_base( detail::kind k, core::string_view s); - BOOST_HTTP_PROTO_DECL + explicit fields_base( detail::header const& h); - BOOST_HTTP_PROTO_DECL + fields_base( fields_base const&); - BOOST_HTTP_PROTO_DECL + fields_base( detail::header const& h, void* storage, @@ -168,7 +173,7 @@ class fields_base std::string value; /// Constructor. - BOOST_HTTP_PROTO_DECL + value_type( reference const& other); @@ -211,7 +216,7 @@ class fields_base /** Destructor. */ - BOOST_HTTP_PROTO_DECL + ~fields_base(); //-------------------------------------------- @@ -283,7 +288,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + core::string_view at(field id) const; @@ -305,13 +310,13 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + core::string_view at(core::string_view name) const; /** Return true if a field exists. */ - BOOST_HTTP_PROTO_DECL + bool exists(field id) const noexcept; @@ -323,7 +328,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + bool exists( core::string_view name) const noexcept; @@ -332,7 +337,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + std::size_t count(field id) const noexcept; @@ -344,7 +349,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + std::size_t count( core::string_view name) const noexcept; @@ -353,7 +358,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + iterator find(field id) const noexcept; @@ -365,7 +370,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + iterator find( core::string_view name) const noexcept; @@ -377,7 +382,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + iterator find( iterator from, @@ -394,7 +399,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + iterator find( iterator from, @@ -408,7 +413,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + iterator find_last( iterator before, @@ -426,7 +431,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + iterator find_last( iterator before, @@ -439,7 +444,7 @@ class fields_base @param s The value to be returned if field does not exist. */ - BOOST_HTTP_PROTO_DECL + core::string_view value_or( field id, @@ -456,7 +461,7 @@ class fields_base @param s The value to be returned if field does not exist. */ - BOOST_HTTP_PROTO_DECL + core::string_view value_or( core::string_view name, @@ -466,7 +471,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + subrange find_all(field id) const noexcept; @@ -478,7 +483,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + subrange find_all( core::string_view name) const noexcept; @@ -519,7 +524,7 @@ class fields_base @par Complexity Constant. */ - BOOST_HTTP_PROTO_DECL + void clear() noexcept; @@ -545,7 +550,7 @@ class fields_base @param n The capacity in bytes. */ - BOOST_HTTP_PROTO_DECL + void reserve_bytes(std::size_t n); @@ -574,7 +579,7 @@ class fields_base @param n The maximum allowed capacity in bytes. */ - BOOST_HTTP_PROTO_DECL + void set_max_capacity_in_bytes(std::size_t n); @@ -584,7 +589,7 @@ class fields_base Strong guarantee. Calls to allocate may throw. */ - BOOST_HTTP_PROTO_DECL + void shrink_to_fit(); @@ -835,7 +840,7 @@ class fields_base @param value The value which must be semantically valid for the message. */ - BOOST_HTTP_PROTO_DECL + iterator insert( iterator before, @@ -884,7 +889,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + iterator insert( iterator before, @@ -936,7 +941,7 @@ class fields_base @param value The value which must be semantically valid for the message. */ - BOOST_HTTP_PROTO_DECL + iterator insert( iterator before, @@ -985,7 +990,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + iterator insert( iterator before, @@ -1012,7 +1017,7 @@ class fields_base @param it The iterator to the element to erase. */ - BOOST_HTTP_PROTO_DECL + iterator erase(iterator it) noexcept; @@ -1033,7 +1038,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + std::size_t erase(field id) noexcept; @@ -1054,7 +1059,7 @@ class fields_base @param name The header name. */ - BOOST_HTTP_PROTO_DECL + std::size_t erase( core::string_view name) noexcept; @@ -1091,7 +1096,7 @@ class fields_base @param value The value which must be semantically valid for the message. */ - BOOST_HTTP_PROTO_DECL + void set(iterator it, core::string_view value); @@ -1123,7 +1128,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + void set( iterator it, @@ -1210,7 +1215,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + void set( field id, @@ -1296,7 +1301,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + void set( core::string_view name, @@ -1337,6 +1342,7 @@ class fields_base @param f The container to write. */ friend + BOOST_HTTP_PROTO_DECL std::ostream& operator<<( @@ -1344,12 +1350,12 @@ class fields_base const fields_base& f); private: - BOOST_HTTP_PROTO_DECL + void copy_impl( detail::header const&); - BOOST_HTTP_PROTO_DECL + void insert_impl( optional id, @@ -1397,4 +1403,8 @@ class fields_base #include +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + #endif diff --git a/include/boost/http_proto/header_limits.hpp b/include/boost/http_proto/header_limits.hpp index 0f8be356..cddfe595 100644 --- a/include/boost/http_proto/header_limits.hpp +++ b/include/boost/http_proto/header_limits.hpp @@ -21,7 +21,7 @@ namespace http_proto { Objects of this type are used to configure upper limits for HTTP headers. */ -struct header_limits +struct BOOST_HTTP_PROTO_DECL header_limits { /** Largest allowed size for complete headers. @@ -116,7 +116,6 @@ struct header_limits number of contiguous bytes of storage that would be needed at these settings. */ - BOOST_HTTP_PROTO_DECL std::size_t valid_space_needed() const; }; diff --git a/include/boost/http_proto/message_base.hpp b/include/boost/http_proto/message_base.hpp index 24e3a995..c7a7d20f 100644 --- a/include/boost/http_proto/message_base.hpp +++ b/include/boost/http_proto/message_base.hpp @@ -15,6 +15,11 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -32,7 +37,7 @@ namespace http_proto { @ref static_request, @ref metadata. */ -class message_base +class BOOST_HTTP_PROTO_DECL message_base : public fields_base { friend class request_base; @@ -126,7 +131,7 @@ class message_base @param n The payload size to set. */ - BOOST_HTTP_PROTO_DECL + void set_payload_size( std::uint64_t n); @@ -143,7 +148,7 @@ class message_base @param n The Content-Length to set. */ - BOOST_HTTP_PROTO_DECL + void set_content_length( std::uint64_t n); @@ -160,7 +165,7 @@ class message_base @param value The value to set. */ - BOOST_HTTP_PROTO_DECL + void set_chunked(bool value); @@ -182,11 +187,15 @@ class message_base @param value The value to set. */ - BOOST_HTTP_PROTO_DECL + void set_keep_alive(bool value); }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // http_proto } // boost diff --git a/include/boost/http_proto/parser.hpp b/include/boost/http_proto/parser.hpp index 6af8c8dd..baade62c 100644 --- a/include/boost/http_proto/parser.hpp +++ b/include/boost/http_proto/parser.hpp @@ -18,6 +18,10 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif #include #include #include @@ -70,7 +74,7 @@ class static_response; @ref response_parser, @ref request_parser. */ -class parser +class BOOST_HTTP_PROTO_DECL parser { public: struct config_base; @@ -98,7 +102,7 @@ class parser @ref response_parser::get, @ref request_parser::get. */ - BOOST_HTTP_PROTO_DECL + bool got_header() const noexcept; @@ -112,14 +116,14 @@ class parser @ref body, @ref start. */ - BOOST_HTTP_PROTO_DECL + bool is_complete() const noexcept; #if 0 /** Return true if any input was committed. */ - BOOST_HTTP_PROTO_DECL + bool got_some() const noexcept; @@ -153,7 +157,7 @@ class parser This function must be called before parsing the first message in a new stream. */ - BOOST_HTTP_PROTO_DECL + void reset() noexcept; @@ -167,7 +171,7 @@ class parser first message being read from the stream or if the previous message has been fully parsed. */ - BOOST_HTTP_PROTO_DECL + void start(); @@ -195,7 +199,7 @@ class parser @ref commit, @ref commit_eof. */ - BOOST_HTTP_PROTO_DECL + mutable_buffers_type prepare(); @@ -223,7 +227,7 @@ class parser @ref parse, @ref prepare. */ - BOOST_HTTP_PROTO_DECL + void commit( std::size_t n); @@ -241,7 +245,7 @@ class parser @ref parse, @ref prepare. */ - BOOST_HTTP_PROTO_DECL + void commit_eof(); @@ -282,7 +286,7 @@ class parser @ref commit, @ref commit_eof. */ - BOOST_HTTP_PROTO_DECL + void parse( system::error_code& ec); @@ -493,7 +497,7 @@ class parser @see @ref config_base::body_limit. */ - BOOST_HTTP_PROTO_DECL + void set_body_limit(std::uint64_t n); @@ -531,7 +535,7 @@ class parser @see @ref consume_body. */ - BOOST_HTTP_PROTO_DECL + const_buffers_type pull_body(); @@ -551,7 +555,7 @@ class parser @see @ref pull_body. */ - BOOST_HTTP_PROTO_DECL + void consume_body(std::size_t n); @@ -587,7 +591,7 @@ class parser @see @ref is_complete. */ - BOOST_HTTP_PROTO_DECL + core::string_view body() const; @@ -605,7 +609,7 @@ class parser @ref metadata::upgrade, @ref metadata::connection. */ // VFALCO rename to get_leftovers()? - BOOST_HTTP_PROTO_DECL + core::string_view release_buffered_data() noexcept; @@ -614,13 +618,13 @@ class parser friend class response_parser; class impl; - BOOST_HTTP_PROTO_DECL ~parser(); - BOOST_HTTP_PROTO_DECL parser() noexcept; - BOOST_HTTP_PROTO_DECL parser(parser&& other) noexcept; - BOOST_HTTP_PROTO_DECL parser(capy::polystore&, detail::kind); - BOOST_HTTP_PROTO_DECL void assign(parser&& other) noexcept; + ~parser(); + parser() noexcept; + parser(parser&& other) noexcept; + parser(capy::polystore&, detail::kind); + void assign(parser&& other) noexcept; - BOOST_HTTP_PROTO_DECL + void start_impl(bool); @@ -630,19 +634,19 @@ class parser static_response const& safe_get_response() const; - BOOST_HTTP_PROTO_DECL + detail::workspace& ws() noexcept; - BOOST_HTTP_PROTO_DECL + bool is_body_set() const noexcept; - BOOST_HTTP_PROTO_DECL + void set_body_impl(buffers::any_dynamic_buffer&) noexcept; - BOOST_HTTP_PROTO_DECL + void set_body_impl(sink&) noexcept; @@ -766,6 +770,7 @@ struct parser::config_base @ref request_parser::config, @ref request_parser. */ + BOOST_HTTP_PROTO_DECL void install_parser_service( @@ -777,4 +782,8 @@ install_parser_service( #include +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + #endif diff --git a/include/boost/http_proto/request.hpp b/include/boost/http_proto/request.hpp index 075d9bcb..9f9205d9 100644 --- a/include/boost/http_proto/request.hpp +++ b/include/boost/http_proto/request.hpp @@ -12,6 +12,11 @@ #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -45,7 +50,7 @@ namespace http_proto { @ref static_request, @ref request_base. */ -class request +class BOOST_HTTP_PROTO_DECL request : public request_base { public: @@ -452,6 +457,10 @@ class request } }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // http_proto } // boost diff --git a/include/boost/http_proto/request_base.hpp b/include/boost/http_proto/request_base.hpp index 450158d3..e4cae26e 100644 --- a/include/boost/http_proto/request_base.hpp +++ b/include/boost/http_proto/request_base.hpp @@ -14,6 +14,11 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -24,7 +29,7 @@ namespace http_proto { @ref request, @ref static_request. */ -class request_base +class BOOST_HTTP_PROTO_DECL request_base : public message_base { friend class request; @@ -285,12 +290,11 @@ class request_base @param b If `true` sets `Expect: 100-continue` header otherwise erase it. */ - BOOST_HTTP_PROTO_DECL void set_expect_100_continue(bool b); private: - BOOST_HTTP_PROTO_DECL + void set_start_line_impl( http_proto::method m, @@ -299,6 +303,10 @@ class request_base http_proto::version v); }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // http_proto } // boost diff --git a/include/boost/http_proto/request_parser.hpp b/include/boost/http_proto/request_parser.hpp index 9c4ef457..680462bb 100644 --- a/include/boost/http_proto/request_parser.hpp +++ b/include/boost/http_proto/request_parser.hpp @@ -17,13 +17,18 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { /// @copydoc parser /// @brief A parser for HTTP/1 requests. /// @see @ref response_parser. -class request_parser +class BOOST_HTTP_PROTO_DECL request_parser : public parser { public: @@ -138,7 +143,6 @@ class request_parser @ref install_parser_service, @ref config. */ - BOOST_HTTP_PROTO_DECL explicit request_parser(capy::polystore& ctx); @@ -160,11 +164,14 @@ class request_parser @see @ref got_header. */ - BOOST_HTTP_PROTO_DECL static_request const& get() const; }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // http_proto } // boost diff --git a/include/boost/http_proto/response.hpp b/include/boost/http_proto/response.hpp index e4086ec2..2995880d 100644 --- a/include/boost/http_proto/response.hpp +++ b/include/boost/http_proto/response.hpp @@ -14,6 +14,11 @@ #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -47,7 +52,7 @@ namespace http_proto { @ref static_response, @ref response_base. */ -class response +class BOOST_HTTP_PROTO_DECL response : public response_base { public: @@ -448,6 +453,10 @@ class response } }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // http_proto } // boost diff --git a/include/boost/http_proto/response_base.hpp b/include/boost/http_proto/response_base.hpp index aea2ddb9..e1c47d3d 100644 --- a/include/boost/http_proto/response_base.hpp +++ b/include/boost/http_proto/response_base.hpp @@ -16,6 +16,11 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -26,7 +31,7 @@ namespace http_proto { @ref response, @ref static_response. */ -class response_base +class BOOST_HTTP_PROTO_DECL response_base : public message_base { friend class response; @@ -141,7 +146,6 @@ class response_base @param v The version to set. */ - BOOST_HTTP_PROTO_DECL void set_version( http_proto::version v); @@ -221,7 +225,7 @@ class response_base } private: - BOOST_HTTP_PROTO_DECL + void set_start_line_impl( http_proto::status sc, @@ -230,6 +234,10 @@ class response_base http_proto::version v); }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + } // http_proto } // boost diff --git a/include/boost/http_proto/serializer.hpp b/include/boost/http_proto/serializer.hpp index e0e65d08..16121704 100644 --- a/include/boost/http_proto/serializer.hpp +++ b/include/boost/http_proto/serializer.hpp @@ -18,6 +18,10 @@ #include #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif #include #include @@ -53,7 +57,7 @@ class message_base; called, or the serializer is destroyed, otherwise the behavior is undefined. */ -class serializer +class BOOST_HTTP_PROTO_DECL serializer { public: class stream; @@ -68,8 +72,7 @@ class serializer /** Destructor */ - BOOST_HTTP_PROTO_DECL - ~serializer(); + ~serializer(); /** Constructor Default-constructed serializers do not reference any implementation; @@ -100,8 +103,7 @@ class serializer @param other The serializer to move from. */ - BOOST_HTTP_PROTO_DECL - serializer( + serializer( serializer&& other) noexcept; /** Assignment. @@ -119,7 +121,7 @@ class serializer @param other The serializer to move from. @return A reference to this object. */ - BOOST_HTTP_PROTO_DECL + serializer& operator=(serializer&& other) noexcept; @@ -168,7 +170,7 @@ class serializer @ref install_serializer_service, @ref config. */ - BOOST_HTTP_PROTO_DECL + explicit serializer( capy::polystore& ctx); @@ -179,7 +181,7 @@ class serializer prepares the serializer to start serialization of a new message. */ - BOOST_HTTP_PROTO_DECL + void reset() noexcept; @@ -217,7 +219,7 @@ class serializer @ref message_base. */ void - BOOST_HTTP_PROTO_DECL + start(message_base const& m); /** Start serializing a message with a buffer sequence body @@ -424,7 +426,7 @@ class serializer @ref stream, @ref message_base. */ - BOOST_HTTP_PROTO_DECL + stream start_stream( message_base const& m); @@ -484,7 +486,7 @@ class serializer @ref is_done, @ref const_buffers_type. */ - BOOST_HTTP_PROTO_DECL + auto prepare() -> system::result< @@ -524,13 +526,12 @@ class serializer @ref is_done, @ref const_buffers_type. */ - BOOST_HTTP_PROTO_DECL + void consume(std::size_t n); /** Return true if serialization is complete. */ - BOOST_HTTP_PROTO_DECL bool is_done() const noexcept; @@ -540,22 +541,22 @@ class serializer template class cbs_gen_impl; - BOOST_HTTP_PROTO_DECL + detail::workspace& ws(); - BOOST_HTTP_PROTO_DECL + void start_init( message_base const&); - BOOST_HTTP_PROTO_DECL + void start_buffers( message_base const&, cbs_gen&); - BOOST_HTTP_PROTO_DECL + void start_source( message_base const&, @@ -665,6 +666,7 @@ struct serializer::config @ref serializer::config, @ref serializer. */ + BOOST_HTTP_PROTO_DECL void install_serializer_service( @@ -694,7 +696,7 @@ install_serializer_service( @see @ref serializer::start_stream */ -class serializer::stream +class BOOST_HTTP_PROTO_DECL serializer::stream { public: /** The type used to represent a sequence @@ -774,7 +776,7 @@ class serializer::stream @throw std::logic_error `this->is_open() == false`. */ - BOOST_HTTP_PROTO_DECL + std::size_t capacity() const; @@ -805,8 +807,7 @@ class serializer::stream @ref commit, @ref capacity. */ - BOOST_HTTP_PROTO_DECL - mutable_buffers_type + mutable_buffers_type prepare(); /** Commit data to the serializer. @@ -837,7 +838,7 @@ class serializer::stream @ref prepare, @ref capacity. */ - BOOST_HTTP_PROTO_DECL + void commit(std::size_t n); @@ -855,7 +856,7 @@ class serializer::stream this->is_open() == false @endcode */ - BOOST_HTTP_PROTO_DECL + void close() noexcept; @@ -885,4 +886,8 @@ class serializer::stream #include +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + #endif diff --git a/include/boost/http_proto/server/route_handler.hpp b/include/boost/http_proto/server/route_handler.hpp index 399310d5..eff13752 100644 --- a/include/boost/http_proto/server/route_handler.hpp +++ b/include/boost/http_proto/server/route_handler.hpp @@ -21,6 +21,11 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -30,11 +35,10 @@ struct acceptor_config bool is_admin; }; -//----------------------------------------------- /** Parameters object for HTTP route handlers */ -struct BOOST_SYMBOL_VISIBLE +struct BOOST_HTTP_PROTO_DECL route_params : route_params_base { /** The complete request target @@ -82,7 +86,6 @@ struct BOOST_SYMBOL_VISIBLE /** Destructor */ - BOOST_HTTP_PROTO_DECL ~route_params(); /** Reset the object for a new request. @@ -90,7 +93,6 @@ struct BOOST_SYMBOL_VISIBLE the previous request, preparing the object for use with a new request. */ - BOOST_HTTP_PROTO_DECL void reset(); /** Set the status code of the response. @@ -101,11 +103,9 @@ struct BOOST_SYMBOL_VISIBLE @param code The status code to set. @return A reference to this response. */ - BOOST_HTTP_PROTO_DECL route_params& status(http_proto::status code); - BOOST_HTTP_PROTO_DECL route_params& set_body(std::string s); @@ -147,9 +147,9 @@ struct BOOST_SYMBOL_VISIBLE protected: /** A task to be invoked later */ - struct task + struct BOOST_HTTP_PROTO_DECL task { - virtual ~task() = default; + virtual ~task(); /** Invoke the task. @@ -163,7 +163,6 @@ struct BOOST_SYMBOL_VISIBLE Subclasses must schedule task_ to be invoked at an unspecified point in the future. */ - BOOST_HTTP_PROTO_DECL virtual void do_post(); std::unique_ptr task_; @@ -245,6 +244,9 @@ post(F&& f) -> route_result }); } +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif } // http_proto } // boost diff --git a/include/boost/http_proto/server/router_types.hpp b/include/boost/http_proto/server/router_types.hpp index 39f2306f..208ba027 100644 --- a/include/boost/http_proto/server/router_types.hpp +++ b/include/boost/http_proto/server/router_types.hpp @@ -19,6 +19,11 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4251) +#endif + namespace boost { namespace http_proto { @@ -36,7 +41,7 @@ using route_result = system::error_code; These values determine how the caller proceeds after invoking a route handler. Each enumerator represents a distinct control - action—whether the request was handled, should continue to the + action—whether the request was handled, should continue to the next route, transfers ownership of the session, or signals that the connection should be closed. */ @@ -157,7 +162,7 @@ class resumer; This holds an reference to an implementation which detaches the handler from its session. */ -class detacher +class BOOST_HTTP_PROTO_DECL detacher { public: /** Base class of the implementation @@ -291,12 +296,13 @@ class any_router; template class basic_router; + /** Base class for request objects This is a required public base for any `Request` type used with @ref basic_router. */ -class route_params_base +class BOOST_HTTP_PROTO_DECL route_params_base { public: /** The mount path of the current router @@ -333,6 +339,12 @@ class route_params_base bool strict = false; }; +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + + + } // http_proto } // boost diff --git a/src/fields_base.cpp b/src/fields_base.cpp index ba62e591..6e069b29 100644 --- a/src/fields_base.cpp +++ b/src/fields_base.cpp @@ -850,6 +850,7 @@ find_all( &h_, find(name).i_); } +BOOST_HTTP_PROTO_DECL std::ostream& operator<<( std::ostream& os, diff --git a/src/server/route_handler.cpp b/src/server/route_handler.cpp index 5aad08e1..9036d967 100644 --- a/src/server/route_handler.cpp +++ b/src/server/route_handler.cpp @@ -20,6 +20,9 @@ route_params:: { } +route_params::task:: +~task() = default; + route_params& route_params:: status(