Skip to content

Commit 54d7fcd

Browse files
committed
Mark add_handler std::function argument as requiring __cdecl to guard against compiler options
1 parent b332591 commit 54d7fcd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Release/include/cpprest/http_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ class http_client
442442
/// Adds an HTTP pipeline stage to the client.
443443
/// </summary>
444444
/// <param name="handler">A function object representing the pipeline stage.</param>
445-
_ASYNCRTIMP void add_handler(const std::function<pplx::task<http_response>(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler);
445+
_ASYNCRTIMP void add_handler(const std::function<pplx::task<http_response> __cdecl(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler);
446446

447447

448448
/// <summary>

Release/src/http/client/http_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ class http_pipeline
331331
pplx::extensibility::recursive_lock_t m_lock;
332332
};
333333

334-
void http_client::add_handler(const std::function<pplx::task<http_response>(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler)
334+
void http_client::add_handler(const std::function<pplx::task<http_response> __cdecl(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler)
335335
{
336336
class function_pipeline_wrapper : public http::http_pipeline_stage
337337
{
338338
public:
339-
function_pipeline_wrapper(const std::function<pplx::task<http_response>(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler) : m_handler(handler)
339+
function_pipeline_wrapper(const std::function<pplx::task<http_response> __cdecl(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler) : m_handler(handler)
340340
{
341341
}
342342

0 commit comments

Comments
 (0)