Skip to content

Commit

Permalink
VS2013 incorrectly reports "warning C4573: the usage of 'symbol' requ…
Browse files Browse the repository at this point in the history
…ires the compiler to capture 'this' but the current default capture mode does not allow it"; the issue and workaround is the same as for GCC 4.7 in commit:5244af7c.
  • Loading branch information
garethsb committed Nov 23, 2017
1 parent 5244af7 commit d0ce63e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Release/src/http/client/http_client_asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
#include <unordered_set>
#include <memory>

#if !defined(__GNUC__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
#if defined(__GNUC__)

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS
#else
// GCC Bug 56222 - Pointer to member in lambda should not require this to be captured
Expand All @@ -54,6 +56,21 @@
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
#endif

#elif defined(_MSC_VER)

#if _MSC_VER >= 1900
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS
#else
// This bug also afflicts VS2013 which incorrectly reports "warning C4573: the usage of 'symbol' requires the compiler to capture 'this' but the current default capture mode does not allow it"
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
#endif

#else

#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS

#endif

using boost::asio::ip::tcp;

#ifdef __ANDROID__
Expand Down

0 comments on commit d0ce63e

Please sign in to comment.