Skip to content

Commit d0ce63e

Browse files
committed
VS2013 incorrectly reports "warning C4573: the usage of 'symbol' requires 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.
1 parent 5244af7 commit d0ce63e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Release/src/http/client/http_client_asio.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
#include <unordered_set>
4545
#include <memory>
4646

47-
#if !defined(__GNUC__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
47+
#if defined(__GNUC__)
48+
49+
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
4850
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS
4951
#else
5052
// GCC Bug 56222 - Pointer to member in lambda should not require this to be captured
@@ -54,6 +56,21 @@
5456
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
5557
#endif
5658

59+
#elif defined(_MSC_VER)
60+
61+
#if _MSC_VER >= 1900
62+
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS
63+
#else
64+
// 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"
65+
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
66+
#endif
67+
68+
#else
69+
70+
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS
71+
72+
#endif
73+
5774
using boost::asio::ip::tcp;
5875

5976
#ifdef __ANDROID__

0 commit comments

Comments
 (0)